<any>
函式
標頭 <any>
會宣告數個可用函式來使用 any
class。
函式
any_cast |
將物件變成 any 。 |
make_any |
取得值並建立 any 物件。 |
swap |
交換兩個 any 物件的項目。 |
any_cast
將物件變成 any
。
template<class T>
T any_cast(const any& operand);
template<class T>
T any_cast(any& operand);
template<class T>
T any_cast(any&& operand);
template<class T>
const T* any_cast(const any* operand) noexcept;
template<class T>
T* any_cast(any* operand) noexcept;
make_any
取得值並建立 any
物件。
template <class T, class... Args>
any make_any(Args&& ...args);
template <class T, class U, class... Args>
any make_any(initializer_list<U> il, Args&& ...args);
swap
交換兩個 any
物件的項目。
void swap(any& left, any& right) noexcept;
參數
left
any
類型的物件。
right
any
類型的物件。
需求
標頭:<any>
命名空間:std
標準: C++17 (至少 /std:c++17
使用 編譯。