Overview
Examples
Screenshots
Comparisons
Applications
Download
Manual
Status & Roadmap
FAQ
Authors & License
Forums
Wiki
Funding Ultimate++
Search on this site











SourceForge.net Logo



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.

 

Public Method List


 

Any(pick_ Any& s)

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

s

Source Any.

 


 

Any()

Constructs an empty Any.

 


 

~Any()

Destructor.

 


 

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.