[concept.assignable] (original) (raw)

18 Concepts library [concepts]

18.4.8 Concept assignable_from [concept.assignable]

template<class LHS, class RHS> concept [assignable_from](#concept:assignable%5Ffrom "18.4.8 Concept assignable_­from [concept.assignable]") = is_lvalue_reference_v<LHS> && [common_reference_with](concept.commonref#concept:common%5Freference%5Fwith "18.4.5 Concept common_­reference_­with [concept.commonref]")<const remove_reference_t<LHS>&, const remove_reference_t<RHS>&> && requires(LHS lhs, RHS&& rhs) { { lhs = std::forward<RHS>(rhs) } -> [same_as](concept.same#concept:same%5Fas "18.4.2 Concept same_­as [concept.same]")<LHS>;};

Let:

LHS and RHS modelassignable_from<LHS, RHS> only if

[Note 1:

Assignment need not be a total function ([structure.requirements]); in particular, if assignment to an object x can result in a modification of some other object y, then x = y is likely not in the domain of =.

— _end note_]