| description | Learn more about: any Class | ||||||
|---|---|---|---|---|---|---|---|
| title | any Class | ||||||
| ms.date | 04/04/2019 | ||||||
| f1_keywords |
|
||||||
| helpviewer_keywords |
|
Stores an instance of any type that satisfies the constructor requirements or it has no value, which is called the state of the class any object.
The stored instance is called the contained value. Two states are the same if either they both have no value, or both have a value and the contained values are the same.
class any| Name | Description |
|---|---|
| any | Constructs an object of type any. |
| Name | Description |
|---|---|
| emplace | Sets an any value. |
| has_value | Returns true if any has a value. |
| reset | Resets an any. |
| swap | Swaps two any objects. |
| type | Returns the any type. |
| Name | Description |
|---|---|
| operator= | Replaces the any with a copy of another any. |
Constructs an object of type any. Also includes a destructor.
constexpr any() noexcept;
any(const any& other);
any(any&& other) noexcept;
template <class T>
any(T&& value);
template <class T, class... Args>
explicit any(in_place_type_t<T>, Args&&...);
template <class T, class U, class... Args>
explicit any(in_place_type_t<T>, initializer_list<U>, Args&&...);
~any();Sets an any value.
template <class T, class... Args>
decay_t<T>& emplace(Args&& ...);
template <class T, class U, class... Args>
decay_t<T>& emplace(initializer_list<U>, Args&&...);Returns true if any has a value.
bool has_value() const noexcept;Replaces the any with a copy of another any.
any& operator=(const any& right);
any& operator=(any&& right) noexcept;
template <class T>
any& operator=(T&& right);right
The any being copied into the any.
Resets an any.
void reset() noexcept;Swaps two any objects.
void swap(any& rhs) noexcept;Returns the any type.
const type_info& type() const noexcept;