YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ystdex::any类 参考

基于类型擦除的动态泛型对象。 更多...

#include <any.h>

类 ystdex::any 继承关系图:
ystdex::any 的协作图:

Public 成员函数

 any () ynoexcept
 
 any (const any &)
 
 any (any &&a) ynoexcept
 
 ~any ()
 
template<typename _type >
anyoperator= (const _type &x)
 
anyoperator= (const any &a)
 复制赋值:使用复制和交换。
 
anyoperator= (any &&a) ynoexcept
 转移赋值:使用复制和交换。
 
bool operator! () const ynoexcept
 
 operator bool () const ynoexcept
 
bool empty () const ynoexcept
 
void * get () const ynoexcept
 
any_ops::holderget_holder () const
 
void clear () ynoexcept
 
void swap (any &a) ynoexcept
 
const std::type_info & type () const ynoexcept
 
template<typename _type , typename = typename std::enable_if<!is_same<_type&, any&>::value, int>::type>
 any (_type &&x)
 
template<typename _type >
 any (std::reference_wrapper< _type > x)
 
template<typename _tHolder >
 any (any_ops::holder_tag, std::unique_ptr< _tHolder > p)
 构造:使用指定持有者。
 
template<typename _type >
 any (_type &&x, any_ops::holder_tag)
 
template<typename _type >
_type * target () ynoexcept
 
template<typename _type >
const _type * target () const ynoexcept
 

Protected 属性

any_ops::any_storage storage
 
any_ops::any_manager manager
 

详细描述

基于类型擦除的动态泛型对象。

注解
值语义。基本接口和语义同 std::any 提议和 boost::any (对应接口以前者为准)。
警告
非虚析构。
参见
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3508.html#synopsis
http://www.boost.org/doc/libs/1_53_0/doc/html/any/reference.html#any.ValueType
自从
build 331
待办事项:
allocator_arg 支持。

在文件 any.h583 行定义.

构造及析构函数说明

ystdex::any::any ( )
inline
后置条件
this->empty()

在文件 any.h595 行定义.

template<typename _type , typename = typename std::enable_if<!is_same<_type&, any&>::value, int>::type>
ystdex::any::any ( _type &&  x)
inline
自从
build 376

在文件 any.h601 行定义.

参考 yforward.

template<typename _type >
ystdex::any::any ( std::reference_wrapper< _type >  x)
inline

在文件 any.h609 行定义.

template<typename _tHolder >
ystdex::any::any ( any_ops::holder_tag  ,
std::unique_ptr< _tHolder >  p 
)
inline

构造:使用指定持有者。

自从
build 395

在文件 any.h619 行定义.

template<typename _type >
ystdex::any::any ( _type &&  x,
any_ops::holder_tag   
)
inline

在文件 any.h625 行定义.

ystdex::any::any ( const any a)

在文件 any.cpp33 行定义.

参考 ystdex::any_ops::clone,manager , 以及 storage.

ystdex::any::any ( any &&  a)
inline

在文件 any.h634 行定义.

ystdex::any::~any ( )
自从
build 382

在文件 any.cpp42 行定义.

参考 ystdex::any_ops::destroy,manager , 以及 storage.

成员函数说明

void ystdex::any::clear ( )

在文件 any.cpp75 行定义.

参考 ystdex::any_ops::destroy,manager , 以及 storage.

bool ystdex::any::empty ( ) const
inline

在文件 any.h679 行定义.

void * ystdex::any::get ( ) const
自从
build 352

在文件 any.cpp49 行定义.

参考 ystdex::pod_storage< _tPOD >::access(),ystdex::any_ops::get_ptr,manager , 以及 storage.

函数调用图:

any_ops::holder * ystdex::any::get_holder ( ) const

在文件 any.cpp62 行定义.

参考 ystdex::pod_storage< _tPOD >::access(),ystdex::any_ops::get_holder_ptr,manager , 以及 storage.

参考自 YSLib::ValueObject::operator==().

函数调用图:

这是这个函数的调用关系图:

ystdex::any::operator bool ( ) const
inlineexplicit

在文件 any.h674 行定义.

bool ystdex::any::operator! ( ) const
inline

在文件 any.h669 行定义.

template<typename _type >
any& ystdex::any::operator= ( const _type &  x)
inline

在文件 any.h643 行定义.

any& ystdex::any::operator= ( const any a)
inline

复制赋值:使用复制和交换。

自从
build 332

在文件 any.h653 行定义.

any& ystdex::any::operator= ( any &&  a)
inline

转移赋值:使用复制和交换。

自从
build 332

在文件 any.h663 行定义.

void ystdex::any::swap ( any a)

在文件 any.cpp85 行定义.

参考 std::swap().

函数调用图:

template<typename _type >
_type* ystdex::any::target ( )
inline
自从
build 352

在文件 any.h700 行定义.

template<typename _type >
const _type* ystdex::any::target ( ) const
inline

在文件 any.h705 行定义.

const std::type_info & ystdex::any::type ( ) const
自从
build 340

在文件 any.cpp92 行定义.

参考 ystdex::pod_storage< _tPOD >::access(),ystdex::any_ops::get_type,manager , 以及 storage.

参考自 ystdex::any_input_iterator< _type, _tDifference, _tPointer, _tReference >::equals().

函数调用图:

这是这个函数的调用关系图:

类成员变量说明


该类的文档由以下文件生成: