std::make_any - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::make_any

From cppreference.com
< cpp‎ | utility‎ | 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)...);

### [edit] See also

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

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/utility/any/make_any&oldid=89638"