<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 26 August 2013 19:00, Jeffrey Yasskin <span dir="ltr"><<a href="mailto:jyasskin@google.com" target="_blank">jyasskin@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The library's running into problems because < is unspecified on<br>
pointers that don't point to the same object. (C++14CD[expr.rel]p4)<br>
Naively, this restriction makes a bit of sense, since we can't give a<br>
particular answer for any two pointers, but it's causing problems for<br>
some generic library components. Specifically:<br>
<br>
std::map<T*> works because std::less has a special case for pointers.<br>
([comparisons]p14)<br>
<br>
std::map<std::tuple<T*>> gives undefined behavior because<br>
std::less<tuple> uses tuple's operator<, which uses T*'s operator<.<br>
<br>
std::map<std::optional<T*>> goes back to defined behavior because we<br>
special-cased optional's operator< to use std::less:<br>
[optional.relops]p4<br></blockquote><div><br>I have strong reasons to believe we'll see an NB comment proposing std::less<br>to be specialized for tuple<T*> and containers. </div></div><br></div></div>