SHOGUN
4.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
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
:
18
Unique
() : data()
19
{
20
data =
new
T();
21
}
22
~Unique
()
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__ */
shogun::Unique::~Unique
~Unique()
Definition:
unique.h:22
shogun::Unique::Unique
Unique()
Definition:
unique.h:18
shogun::Unique::operator->
T * operator->() const
Definition:
unique.h:30
shogun::Unique
Definition:
unique.h:15
shogun::Unique::operator=
Unique & operator=(const Unique &other)
SHOGUN
Machine Learning Toolbox - Documentation