Files
2025-10-25 03:02:53 +03:00

4.4 KiB

[expr.context]

7 Expressions [expr]

7.2 Properties of expressions [expr.prop]

7.2.3 Context dependence [expr.context]

1

#

In some contexts, unevaluated operands appear ([expr.prim.req.simple], [expr.prim.req.compound], [expr.typeid], [expr.sizeof], [expr.unary.noexcept], [expr.reflect], [dcl.type.decltype], [temp.pre], [temp.concept]).

An unevaluated operand is not evaluated.

[Note 1:

In an unevaluated operand, a non-static class member can be named ([expr.prim.id]) and naming of objects or functions does not, by itself, require that a definition be provided ([basic.def.odr]).

An unevaluated operand is considered a full-expression.

— end note]

2

#

In some contexts, an expression only appears for its side effects.

Such an expression is called a discarded-value expression.

The array-to-pointer and function-to-pointer standard conversions are not applied.

The lvalue-to-rvalue conversion is applied if and only if the expression is a glvalue of volatile-qualified type and it is one of the following:

( expression ), whereexpression is one of these expressions,

id-expression ([expr.prim.id]),

splice-expression ([expr.prim.splice]),

subscripting,

class member access,

indirection,

pointer-to-member operation,

conditional expression where both the second and the third operands are one of these expressions, or

comma expression where the right operand is one of these expressions.

[Note 2:

Using an overloaded operator causes a function call; the above covers only operators with built-in meaning.

— end note]

The temporary materialization conversion ([conv.rval]) is applied if the (possibly converted) expression is a prvalue of object type.

[Note 3:

If the original expression is an lvalue of class type, it must have a volatile copy constructor to initialize the temporary object that is the result object of the temporary materialization conversion.

— end note]

The expression is evaluated and its result (if any) is discarded.