libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ any_cast() [5/5]

template<typename _ValueType>
const _ValueType * std::experimental::fundamentals_v1::any_cast ( const any * __any)
inlinenoexcept

Access the contained object.

Template Parameters
_ValueTypeThe type of the contained object.
Parameters
__anyA pointer to the object to access.
Returns
The address of the contained object if __any != nullptr && __any.type() == typeid(_ValueType) , otherwise a null pointer.

Definition at line 472 of file experimental/any.

473 {
474 if (__any)
475 return static_cast<_ValueType*>(__any_caster<_ValueType>(__any));
476 return nullptr;
477 }