An implementation of std::any_cast, which uses type_info::hash_code to check validity of cast types.
More...
|
void | swap (any &x, any &y) noexcept |
| Exchange the states of two any objects.
|
|
template<typename T , typename... Args> |
std::enable_if_t< std::is_constructible_v< any, std::in_place_type_t< T >, Args... >, any > | make_any (Args &&... args) |
| Create a any holding a T constructed from args...
|
|
template<typename T , typename U , typename... Args> |
std::enable_if_t< std::is_constructible_v< any, std::in_place_type_t< T >, std::initializer_list< U > &, Args... >, any > | make_any (std::initializer_list< U > il, Args &&... args) |
| Create an any holding a T constructed from il and args... .
|
|
template<typename ValueType > |
ValueType | any_cast (const any &any) |
| Access the contained object.
|
|
|
template<typename ValueType > |
ValueType | any_cast (any &any) |
| Access the contained object.
|
|
template<typename ValueType > |
ValueType | any_cast (any &&any) |
|
|
template<typename ValueType > |
const ValueType * | any_cast (const any *any) noexcept |
| Access the contained object.
|
|
template<typename ValueType > |
ValueType * | any_cast (any *any) noexcept |
|
An implementation of std::any_cast, which uses type_info::hash_code to check validity of cast types.
This is required as Clang compares types as being equivalent based on their type_info pointer locations. These are not guaranteed to be the same with identical types linked in multiple targets from shared libraries. The current Clang implementation of type_info::hash_code is based on the type names, which should be consistent across translation units.