Created on 2011-05-01.00:00:00 last changed 111 months ago
Proposed resolution:
N4387.[ Lenexa 2015-05-05 ]
VV: While in the area of tuples, LWG 2051 should have status of WP, it is resolved by Daniel's "improving pair and tuple" paper.
MC: status Resolved, by N4387
[ Portland, 2012 ]
Move to Open at the request of the Evolution Working Group.
[ Bloomington, 2011 ]
Move to NAD Future, this would be an extension to existing functionality.
One of my constituents wrote the following:
-------snip------------ So far the only use I've found for std::tuple is as an ad-hoc type to emulate multiple return values. If the tuple ctor was made non-explicit one could almost think C++ supported multiple return values especially when combined with std::tie().// assume types line_segment and point // assume function double distance(point const&, point const&) std::tuple<point, point> closest_points(line_segment const& a, line_segment const& b) { point ax; point bx; /* some math */ return {ax, bx}; } double distance(line_segment const& a, line_segment const& b) { point ax; point bx; std::tie(ax, bx) = closest_points(a, b); return distance(ax, bx); }
-------snap----------
See also the messages starting from lib-29330. Some notes:I would recommend making non-unary tuple constructors non-explicit.
History | |||
---|---|---|---|
Date | User | Action | Args |
2015-09-27 20:30:23 | admin | set | messages: + msg7544 |
2015-09-27 20:30:23 | admin | set | messages: + msg7543 |
2015-09-27 20:30:23 | admin | set | status: open -> resolved |
2012-10-19 07:50:57 | admin | set | messages: + msg6179 |
2012-10-19 07:50:57 | admin | set | status: nad future -> open |
2011-08-16 10:45:53 | admin | set | messages: + msg5839 |
2011-08-16 10:45:53 | admin | set | status: new -> nad future |
2011-05-01 00:00:00 | admin | create |