Namespaces
Variants
Views
Actions

std::make_any

From cppreference.com
< cpp‎ | utility‎ | any
Revision as of 21:39, 8 July 2016 by T. Canens (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
 
template< class T, class... Args >
std::any make_any( Args&&... args );
(1) (since C++17)
template< class U, class T, class... Args >
std::any make_any( std::initializer_list<U> il, Args&&... args );
(2) (since C++17)

Constructs an any object containing an object of type T, passing the provided arguments to T's constructor.

1) Equivalent to return std::any(std::in_place<T>, std::forward<Args>(args)...);
2) Equivalent to return std::any(std::in_place<T>, il, std::forward<Args>(args)...);

See also

constructs an any object
(public member function) [edit]