You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Send P2255r1 to LEWG, with a recommendation to send it to Electronic Polling with the currently specified semantics. Only do so if LEWG agrees that the type traits as specified are useful and usable for pair, tuple, and function.
A short summary of the comments from LEWG's Mailing list:
std::tuple<const std::string&> x("hello"); is ill-formed, but the usage f(tuple<const string&>("hello")) seems desirable
Author: I lean toward defining the ctor as deleted, so that the example is still rejected. tuple<const string&>("hello"s) (or the equivalent std::string("hello")) remains available.
Worried about false positives the trait may produce.
Author: It produces an inevitably-dangling reference with tuple as specified today. Whether we go on to produce a likely-dangling reference or just reject the code outright seems like a somewhat separate decision to me; either way, it doesn't affect any existing valid C++20 code.
Activity
wg21bot commentedon Apr 25, 2021
P2255R1 A type trait to detect reference binding to temporary (Tim Song)
jfbastien commentedon May 12, 2021
EWG saw the paper in today's telecon.
Send P2255r1 to LEWG, with a recommendation to send it to Electronic Polling with the currently specified semantics. Only do so if LEWG agrees that the type traits as specified are useful and usable for pair, tuple, and function.
inbal2l commentedon May 20, 2021
A short summary of the comments from LEWG's Mailing list:
std::tuple<const std::string&> x("hello");
is ill-formed, but the usagef(tuple<const string&>("hello"))
seems desirableAuthor: I lean toward defining the ctor as deleted, so that the example is still rejected. tuple<const string&>("hello"s) (or the equivalent std::string("hello")) remains available.
Author: It produces an inevitably-dangling reference with tuple as specified today. Whether we go on to produce a likely-dangling reference or just reject the code outright seems like a somewhat separate decision to me; either way, it doesn't affect any existing valid C++20 code.
R1 is ready for LEWG Telecon.
30 remaining items