std::copyable(3)
π 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
- 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