SHOGUN
4.1.0
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
base
unique.h
浏览该文件的文档.
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::~Unique
~Unique()
Definition:
unique.h:27
shogun::Unique::Unique
Unique()
Definition:
unique.h:23
shogun::Unique::operator->
T * operator->() const
Definition:
unique.h:38
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
机器学习工具包 - 项目文档