std::experi...nstructible(3)
hey bestie π welcome to the std::experi...nstructible(3) page from the C++ Standard Libary β this one is all about std::experimental::ranges::CopyConstructible, and it's lowkey iconic for anyone deep in Ranges TS concept land. β¨
π NAME π
std::experimental::ranges::CopyConstructibleβstd::experimental::ranges::CopyConstructible(yes, same name twice, it's giving "the concept is the concept" energy π ).
β¨ Synopsis β¨
Defined in header <experimental/ranges/concepts>.
Here's the exact declaration, no cap:
template< class T >
concept bool CopyConstructible =
MoveConstructible<T> &&
(ranges TS)
Constructible<T, T&> && ConvertibleTo<T&, T> &&
Constructible<T, const T&> && ConvertibleTo<const T&, T> &&
Constructible<T, const T> && ConvertibleTo<const T, T>;
So the vibe is: the concept CopyConstructible is satisfied if T is an lvalue reference type, or if it is a MoveConstructible object type where an object of that type can constructed from a (possibly const) lvalue or const rvalue of that type in both direct- and copy-initialization contexts with the usual semantics (a copy is constructed with the source unchanged).
More precisely, if T is an object type, then CopyConstructible<T> is satisfied only if given
v, an lvalue of type (possibly const)Tor an rvalue of typeconst T,
the following are true:
- After the definition
T u = v;,uis equal tov; T{v}is equal tov.
π See also π
is_copy_constructibleβ checks if a type has a copy constructor,(C++11),(class template)is_trivially_copy_constructibleβ checks if a type has a copy constructor,(C++11),(class template)is_nothrow_copy_constructibleβ checks if a type has a copy constructor,(C++11),(class template)
okay bestie, that's the whole page π source/version/date sign-off: http://cppreference.com, 2024.06.10, page tag std::experi...nstructible(3) β periodt. π«Άπ
π¦ 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