SHOGUN  6.1.3
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:
23  Unique() : data()
24  {
25  data = new T();
26  }
28  {
29  delete reinterpret_cast<T*>(data);
30  }
31 
33  Unique(const Unique&);
35  Unique& operator=(const Unique& other);
36 
38  inline T* operator->() const
39  {
40  return reinterpret_cast<T*>(data);
41  }
42  private:
44  void* data;
45  };
46 
47 }
48 #endif /* __SG_UNIQUE_H__ */
T * operator->() const
Definition: unique.h:38
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