GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::experimental::any_cast(3) C++ Standard Libary std::experimental::any_cast(3)

std::experimental::any_cast - std::experimental::any_cast


template<class ValueType> (1) (library fundamentals TS)
ValueType any_cast(const any& operand);
template<class ValueType> (2) (library fundamentals TS)
ValueType any_cast(any& operand);
template<class ValueType> (3) (library fundamentals TS)
ValueType any_cast(any&& operand);
template<class ValueType>
const ValueType* any_cast(const any* operand) (4) (library fundamentals TS)
noexcept;
template<class ValueType> (5) (library fundamentals TS)
ValueType* any_cast(any* operand) noexcept;


Performs type-safe access to the contained object.


For (1-3), the program is ill-formed if ValueType is not a reference and
std::is_copy_constructible<ValueType>::value is false.


operand - target any object


1) Returns
*any_cast<std::add_const_t<std::remove_reference_t<ValueType>>>(&operand).
2-3) Returns *any_cast<std::remove_reference_t<ValueType>>(&operand).
4-5) If operand is not a null pointer, and the typeid of the requested ValueType
matches that of the contents of operand, a pointer to the value contained by
operand, otherwise a null pointer.


1-3) Throws bad_any_cast if the typeid of the requested ValueType does not match
that of the contents of operand.

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.