description | title | ms.date | f1_keywords | no-loc | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Learn more about the free functions for use with the std::any class in the C++ Standard Library. |
<any> functions |
09/20/2021 |
|
|
The <any>
header declares several free functions for working with the any
class.
any_cast |
Makes an object into an any . |
make_any |
Takes values and creates an any object. |
swap |
Exchanges the elements of two any objects. |
Makes an object into an any
.
template<class T>
T any_cast(const any& operand);
template<class T>
T any_cast(any& operand);
template<class T>
T any_cast(any&& operand);
template<class T>
const T* any_cast(const any* operand) noexcept;
template<class T>
T* any_cast(any* operand) noexcept;
Takes values and creates an any
object.
template <class T, class... Args>
any make_any(Args&& ...args);
template <class T, class U, class... Args>
any make_any(initializer_list<U> il, Args&& ...args);
Exchanges the elements of two any
objects.
void swap(any& left, any& right) noexcept;
left
An object of type any
.
right
An object of type any
.
Header: <any>
Namespace: std
Standard: C++17 (Use at least /std:c++17
to compile.)