template< class T, class... Args > std::any make_any( Args&&... args ); | (1) | (since C++17) |
template< class T, class U, 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.
return std::any(std::in_place_type<T>, std::forward<Args>(args)...);
return std::any(std::in_place_type<T>, il, std::forward<Args>(args)...);
constructs an any object (public member function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/utility/any/make_any