std::make_any

From cppreference.com
< cpp‎ | utility‎ | any
 
 
 
std::any
Member functions
Modifiers
Observers
Non-member functions
make_any
 
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.

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

See also

constructs an any object
(public member function)