Document #: | P2102R0 |
Date: | 2020-02-11 |
Project: | Programming Language C++ LWG |
Reply-to: |
Tim Song <t.canens.cpp@gmail.com> Casey Carter <casey@carter.net> |
This paper provides wording to resolve NB comment US185.
This wording is relative to [N4849].
An expression is equality-preserving if, given equal inputs, the expression results in equal outputs. The inputs to an expression are the set of the expression’s operands. The output of an expression is the expression’s result and all operands modified by the expression. For the purposes of this subclause, the operands of an expression are the largest subexpressions that include only:
- (1.1) an id-expression (7.5.4 [expr.prim.id]), and
- (1.2) invocations of the library function templates
std::move
,std::forward
, andstd::declval
(20.2.4 [forward], 20.2.6 [declval])[ Example: The operands of the expression
a = std::move(b)
area
andstd::move(b)
. — end example ]
An expression that may alter the value of one or more of its inputs in a manner observable to equality-preserving expressions is said to modify those inputs. This document uses a notational convention to specify which expressions declared in a requires-expression modify which inputs: except where otherwise specified, an expression operand that is a non-constant lvalue or rvalue may be modified. Operands that are constant lvalues or rvalues are required to not be modified. For the purposes of this subclause, the cv-qualification and value category of each operand is determined by assuming that each template type parameter denotes a cv-unqualified complete non-array object type.
assignable_from
for copyable
:indirectly_writable
for indirectly_copyable_storable
:template<class In, class Out> concept indirectly_copyable_storable = indirectly_copyable<In, Out> && + indirectly_writable<Out, iter_value_t<In>&> && indirectly_writable<Out, const iter_value_t<In>&> && + indirectly_writable<Out, iter_value_t<In>&&> && + indirectly_writable<Out, const iter_value_t<In>&&> && copyable<iter_value_t<In>> && constructible_from<iter_value_t<In>, iter_reference_t<In>> && assignable_from<iter_value_t<In>&, iter_reference_t<In>>;
[N4849] Richard Smith. 2020. Working Draft, Standard for Programming Language C++.
https://wg21.link/n4849