std::copyable(3)

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

πŸ’… NAME πŸ’…

okay bestie, welcome to std::copyable(3) from the C++ Standard Libary manual β€” yes, the header really says β€œLibary” and we are keeping that energy πŸ’€.

  • std::copyable β€” std::copyable β€” like, the concept herself. main character energy, no cap πŸ‘‘

✨ Synopsis ✨

so this concept lives in the header <concepts>, and here’s the exact vibe:

          Defined in header <concepts>
          template< class T >

          concept copyable =
              std::copy_constructible<T> &&
              std::movable<T> &&                     (since C++20)
              std::assignable_from<T&, T&> &&
              std::assignable_from<T&, const T&> &&

              std::assignable_from<T&, const T>;

The concept copyable<T> specifies that T is a movable object type that can also be copied β€” that is, it supports copy construction and copy assignment. literally the whole point, fr fr πŸ’–.

since C++20, bestie β€” put that in your notes ✨

πŸ‘€ See also πŸ‘€

  • movable β€” specifies that an object of a type can be moved and swapped (C++20) (concept). lowkey the sibling concept you should also check out πŸ¦‹

mwah πŸ’‹ β€” source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::copyable(3), k bye bestie 🫢✨

πŸ“¦ where this page comes from