std::experi...al::any::any(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

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. (1) β€” Constructs an empty object.
  2. (2) β€” Copies the content of other into a new instance, so that any content is equivalent in both type and value to those of other prior to the constructor call, or empty if other is empty.
  3. (3) β€” Moves the content of other into a new instance, so that any content is equivalent in both type and value to those of other prior to the constructor call, or empty if other is empty.
  4. (4) β€” Constructs an object with initial content an object of type std::decay_t<ValueType>, direct-initialized from std::forward<ValueType>(value). If std::is_copy_constructible<std::decay_t<ValueType>>::value is false, the program is ill-formed. This overload participates in overload resolution only if std::decay_t<ValueType> is not the same type as any.
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 of CopyConstructible.

πŸ¦‹ Parameters πŸ¦‹

  • other β€” another any object to copy or move from
  • value β€” 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 an any object (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