In C++, a conditional expression is a valid lvalue if its type is not void, and its result is an lvalue.
Type of one operand | Type of other operand | Type of result |
---|---|---|
Reference to type | Reference to type | Reference after usual reference conversions |
Class T | Class T | Class T |
Class T | Class X | Class type for which a conversion exists. If more than one possible conversion exists, the result is ambiguous. |
throw expression | Other (type, pointer, reference) | Type of the expression that is not a throw expression |