Created on 2005-11-29.00:00:00 last changed 122 months ago
[ San Francisco: ]
Solved by N2770.
Rationale:
Recommend NAD. This will be fixed with the next revision of concepts.
[ Berlin: This issue is much bigger than just tuple (pair, containers, algorithms). Dietmar will survey and work up proposed wording. ]
Proposed resolution:
change 6.1.3.5/5 from:
Returns: The result of a lexicographical comparison between t and u. The result is defined as: (bool)(get<0>(t) < get<0>(u)) || (!(bool)(get<0>(u) < get<0>(t)) && ttail < utail), where rtail for some tuple r is a tuple containing all but the first element of r. For any two zero-length tuples e and f, e < f returns false.
to:
Returns: The result of a lexicographical comparison between t and u. For any two zero-length tuples e and f, e < f returns false. Otherwise, the result is defined as: cmp( get<0>(t), get<0>(u)) || (!cmp(get<0>(u), get<0>(t)) && ttail < utail), where rtail for some tuple r is a tuple containing all but the first element of r, and cmp(x,y) is an unspecified function template defined as follows.
Where T is the type of x and U is the type of y:
if T and U are pointer types and T is convertible to U, returns less<U>()(x,y)
otherwise, if T and U are pointer types, returns less<T>()(x,y)
otherwise, returns (bool)(x < y)
[ 2009-10 Santa Cruz: ]
If we solve this for tuple we would have to solve it for pair algorithms, etc. It is too late to do that at this time. Move to NAD Future.
[ 2009-07-28 Reopened by Alisdair. No longer solved by concepts. ]
Where possible, tuple comparison operators <,<=,=>, and > ought to be defined in terms of std::less rather than operator<, in order to support comparison of tuples of pointers.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-11-24 15:11:58 | admin | set | status: nad future -> lewg |
2010-10-21 18:28:33 | admin | set | messages: + msg2975 |
2010-10-21 18:28:33 | admin | set | messages: + msg2974 |
2010-10-21 18:28:33 | admin | set | messages: + msg2973 |
2010-10-21 18:28:33 | admin | set | messages: + msg2972 |
2010-10-21 18:28:33 | admin | set | messages: + msg2971 |
2010-10-21 18:28:33 | admin | set | messages: + msg2970 |
2005-11-29 00:00:00 | admin | create |