SHOGUN
6.0.0
src
shogun
base
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
}
27
~Unique
()
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__ */
shogun::Unique::operator->
T * operator->() const
Definition:
unique.h:38
shogun::Unique::~Unique
~Unique()
Definition:
unique.h:27
shogun::Unique::Unique
Unique()
Definition:
unique.h:23
shogun
all of classes and functions are contained in the shogun namespace
Definition:
class_list.h:18
shogun::Unique
Definition:
unique.h:15
shogun::Unique::operator=
Unique & operator=(const Unique &other)
SHOGUN
Machine Learning Toolbox - Documentation