SHOGUN  4.1.0
unique.h
Go to the documentation of this file.
1 #ifndef __SG_UNIQUE_H__
2 #define __SG_UNIQUE_H__
3 
4 namespace shogun
5 {
6 
14  template <typename T>
15  class Unique
16  {
17  public:
18  Unique() : data()
19  {
20  data = new T();
21  }
23  {
24  delete reinterpret_cast<T*>(data);
25  }
26 
27  Unique(const Unique& other);
28  Unique& operator=(const Unique& other);
29 
30  inline T* operator->() const
31  {
32  return reinterpret_cast<T*>(data);
33  }
34  private:
35  void* data;
36  };
37 
38 }
39 #endif /* __SG_UNIQUE_H__ */
T * operator->() const
Definition: unique.h:30
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
Unique & operator=(const Unique &other)

SHOGUN Machine Learning Toolbox - Documentation