Type of Conditional C++ Expressions

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

Related References

IBM Copyright 2003