Обзор
Примеры
Скриншоты
Сравнения
Приложения
Загрузить
Руководства
Базар
Статус и История
Частые вопросы (FAQ)
Авторы и лицензия
Форум
Помощь проекту
Поиск по сайту
Язык
русский













SourceForge.net Logo



Эта страница еще не переведена. Вы хотите перевести?

 

Any

 

class Any : private Moveable<Any>

Any is a special type of container capable of containing none or single element of any type. It also provides methods for querying the type stored and retrieving the content of specific type.

Any has pick semantics.

 

 

Constructor Detail

 

Any()

Constructs an empty Any.

 


 

Any(pick_ Any& s)

Pick constructor. Transfers content of source Any s while destroying its content by picking..

 


 

~Any()

Default destructor.

 

 

Public Method List

 

template <class T> T& Create()

Creates content of type T inside Any.

T

Type of content.

Return value

Reference to the newly created content.

 


 

template <class T> bool Is() const

Tests whether Any contains content of type T.

T

Required type.

Return value

true if there is content with type T in Any.

 


 

template <class T> T& Get()

Returns reference to content. Is<T> must be true, otherwise this operation is illegal.

T

Required type.

Return value

Reference to content.

 


 

template <class T> const T& Get() const

Returns constant reference to content. Is<T> must be true, otherwise this operation is illegal.

T

Required type.

Return value

Reference to content.

 


 

void Clear()

Removes (and destroys) content.

 


 

bool IsEmpty() const

Return value

true if there is no content.

 


 

bool IsPicked() const

Return value

true if Any is picked.

 


 

void operator=(pick_ Any& s)

Pick operator. Transfers content while destroying source.

s

Source Any.

 

 

Страница доступна на english языке. Вы хотите внести вклад?