std::experi...nstructible(3)
π std::experimental::ranges::MoveConstructible
okay so bestie, welcome to the <span>... jk, it's just std::experimental::ranges::MoveConstructible, page 3 of the C++ Standard Libary man pages π (yes that's how the libary spells it, don't come for me π). Sit down, grab a strawberry drink π, and let's get into it.
β¨ NAME β¨
std::experimental::ranges::MoveConstructible β literally the exact same thing again, <pink>std::experimental::ranges::MoveConstructible</pink> π (name so nice they said it twice, iconic behavior tbh π)
πΈ Synopsis πΈ
First things first, this whole vibe lives in the header:
#include <experimental/ranges/concepts>
and it's shaped like this:
template< class T >
concept bool MoveConstructible = (ranges TS)
Constructible<T, T> && ConvertibleTo<T, T>;
No cap, the concept MoveConstructible is satisfied if T is a reference type, or if it's an object type where an object of that type can be constructed from an rvalue of that type β in both direct-initialization and copy-initialization contexts β with the usual semantics π«Ά.
π¦ more precisely, bestie π¦
If T is an object type, then MoveConstructible<T> is satisfied only if given:
rv, an rvalue of typeT, andu2, a distinct object of typeTequal torv,
the following are true, periodt:
- After the definition
T u = rv;,uis equal tou2; T{rv}is equal tou2; and- If
Tis not const-qualified, thenrv's resulting state (after the definition/expression is evaluated in either bullets above) is valid but unspecified; otherwise, it is unchanged.
β οΈ not me flagging the "valid but unspecified" part: that's a real vibe check from the standard, it doesn't promise you anything specific aboutrvafterward π it's legal, it's just not telling you what's in there. And ifTis const-qualified? Then it's unchanged, full stop π
π See also π
is_move_constructibleβ (C++11), class template β¨is_trivially_move_constructibleβ checks if a type can be constructed from an rvalue reference, (C++11), class template πis_nothrow_move_constructibleβ (C++11), class template π
(iykyk β all three are the C++11 class-template girlies in the same club π)
that's the whole page bestie, no crumbs left πβ¨ this little icon was served up from http://cppreference.com, dated 2024.06.10, and its footer reads std::experi...nstructible(3) β slay, go move-construct something responsibly π
π
π¦ 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