std::experi...al::any::any(3)
okay bestie, welcome to the std::experi...al::any::any(3) page from the C++ Standard Libary β yes, that's the manual name in the header, spelling and all, and we're rolling with it π. This is the std::experimental::any::any constructor page, and it's giving overload family main character energy.
π NAME π
std::experimental::any::anyβstd::experimental::any::any
ngl, the NAME line is literally the same name twice, and honestly? iconic. π
β¨ Synopsis β¨
any() noexcept; (1) (library fundamentals TS)
any( const any& other ); (2) (library fundamentals TS)
any( any&& other ) noexcept; (3) (library fundamentals TS)
template<typename ValueType> (4) (library fundamentals TS)
any( ValueType&& value );
Constructs a new any object. That's the whole vibe check π₯.
(1)β Constructs an empty object.(2)β Copies the content ofotherinto a new instance, so thatanycontent is equivalent in both type and value to those ofotherprior to the constructor call, or empty ifotheris empty.(3)β Moves the content ofotherinto a new instance, so thatanycontent is equivalent in both type and value to those ofotherprior to the constructor call, or empty ifotheris empty.(4)β Constructs an object with initial content an object of typestd::decay_t<ValueType>, direct-initialized fromstd::forward<ValueType>(value). Ifstd::is_copy_constructible<std::decay_t<ValueType>>::valueis false, the program is ill-formed. This overload participates in overload resolution only ifstd::decay_t<ValueType>is not the same type asany.
bestie, that ill-formed part is not a drill β if std::is_copy_constructible<std::decay_t<ValueType>>::value is false, the program is ill-formed, periodt. π
π§ Template parameters π§
ValueTypeβ contained value type
πΈ Type requirements πΈ
std::decay_t<ValueType>must meet the requirements ofCopyConstructible.
π¦ Parameters π¦
otherβ anotheranyobject to copy or move fromvalueβ value to initialize the contained value with
π Exceptions π
2,4β Throws any exception thrown by the constructor of the contained type.
π₯ See also π₯
operator=β assigns ananyobject (public member function)
π Category π
Noindexed pages
okay that's the page, bestie! π«Ά source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::experi...al::any::any(3) β mwah, bye π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms