I am retelling comp.std.C ++ Usenet discussion here because this group has become very unreliable. The last few messages that I sent there fell into the void, and the activity almost stopped. I doubt that I was banned, and / or everyone else just lost interest. We hope that all interested people will find this discussion, and there will be general migration. Maybe then they will appoint a new moderator.
Hello!
With my current interpretation of the N3126 wrt project of the conditional operator and x values, I expect the following statements to be true:
int i = 0;
int& j = true? i : i;
int&& k = true? std::move(i) : std::move(i);
assert(&i == &j);
assert(&i == &k);
5.16 / 4 says:
If the second and third operands [to the conditional operator] glvalues of the same category of values and have the same type, the result of this type and value [...]
, , glvalue
, glvalue,
, prvalue? GCC 4.5.1
++ 0x . k
. - ,
comiler ,
- x ?
, GCC /
x.
:
?
decltype.
bool xvalue = std::is_rvalue_reference<
decltype( true ? std::move(i) : std::move(i) ) >::value;
? GCC 4.5.1, xvalue
. ?
,