S. B. Tam
unread,Aug 16, 2016, 1:23:30 PM8/16/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ISO C++ Standard - Discussion
N4606 [expr.cond]/(4.3) reads:
— (4.3) If E2 is a prvalue or if neither of the conversion sequences above can be formed and at least one of the
operands has (possibly cv-qualified) class type:
— (4.3.1) if T1 and T2 are the same class type (ignoring cv-qualification), or one is a base class of the other,
and T2 is at least as cv-qualified as T1, the target type is T2,
— (4.3.2) otherwise, the target type is the type that E2 would have after applying the lvalue-to-rvalue (4.1),
array-to-pointer (4.2), and function-to-pointer (4.3) standard conversions.
It seems that to satisfy the condition in (4.3.1), T2 must be a class type, in which case T2 is the same as the type that E2 would have after applying the lvalue-to-rvalue, array-to-pointer, and function-to-pointer standard conversions (since lvalue-to-rvalue conversion does not alter the type, and array-to-pointer and function-to-pointer conversions do not apply to class types). So, could (4.3) be simplified to:
— (4.3) If E2 is a prvalue or if neither of the conversion sequences above can be formed and at least one of the
operands has (possibly cv-qualified) class type, the target type is the type that E2 would have after applying the
lvalue-to-rvalue (4.1), array-to-pointer (4.2), and function-to-pointer (4.3) standard conversions.
?