| Technical Specification | ||||
| Filesystem library(filesystem TS) | ||||
| Library fundamentals(library fundamentals TS) | ||||
| Library fundamentals 2(library fundamentals TS v2) | ||||
| Library fundamentals 3(library fundamentals TS v3) | ||||
| Extensions for parallelism(parallelism TS) | ||||
| Extensions for parallelism 2(parallelism TS v2) | ||||
| Extensions for concurrency(concurrency TS) | ||||
| Extensions for concurrency 2(concurrency TS v2) | ||||
| Concepts(concepts TS) | ||||
| Ranges(ranges TS) | ||||
| Reflection(reflection TS) | ||||
| Mathematical special functions(special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
| Member functions | ||||
| Modifiers | ||||
| Observers | ||||
| Non-member functions | ||||
any_cast |
template<class ValueType> ValueType any_cast(const any& operand); | (1) | (library fundamentals TS) |
template<class ValueType> ValueType any_cast(any& operand); | (2) | (library fundamentals TS) |
template<class ValueType> ValueType any_cast(any&& operand); | (3) | (library fundamentals TS) |
template<class ValueType> const ValueType* any_cast(const any* operand)noexcept; | (4) | (library fundamentals TS) |
template<class ValueType> ValueType* any_cast(any* operand)noexcept; | (5) | (library fundamentals TS) |
Performs type-safe access to the contained object.
For(1-3), the program is ill-formed ifValueType is not a reference andstd::is_copy_constructible<ValueType>::value isfalse.
| operand | - | targetany object |
typeid of the requestedValueType matches that of the contents ofoperand, a pointer to the value contained byoperand, otherwise a null pointer.bad_any_cast if thetypeid of the requestedValueType does not match that of the contents ofoperand.