Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
UppHub
Status & Roadmap
FAQ
Authors & License
Forums
Funding U++
Search on this site











SourceForge.net Logo

SourceForge.net Logo

GitHub Logo

Discord 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, class... ArgsT& Create(Args&&... args)

Creates content of type T inside Any. Additional parameters to constructor can be specified.

 


 

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.

 


 

void operator=(Any&& s)

Pick assignment.

 


 

Any(Any&& s)

Pick constructor.

 

Do you want to contribute?