std::experi...nstructible(3)

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

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) T or an rvalue of type const T,

the following are true:

  • After the definition T u = v;, u is equal to v;
  • T{v} is equal to v.

πŸ’… 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