<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 17 October 2013 23:13, Gabriel Dos Reis <span dir="ltr"><<a href="mailto:gdr@axiomatics.org" target="_blank">gdr@axiomatics.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Nevin Liber <<a href="mailto:nevin@eviloverlord.com" target="_blank">nevin@eviloverlord.com</a>> writes:<br>
<br>
| On 17 October 2013 19:18, Gabriel Dos Reis <<a href="mailto:gdr@axiomatics.org" target="_blank">gdr@axiomatics.org</a>> wrote:<br>
|<br>
|<br>
| The implication in question is this:<br>
|<br>
| p == q => intptr_t(p) == intptr_t(q)<br>
|<br>
| where p and q are pointers. I am having trouble following how, even on<br>
| such <b>exotic architecture</b>, the implication will be affected.<br>
|<br>
|<br>
| I can imagine that on a system concerned with security where sizeof(intptr_t) ><br>
| sizeof(p) random salt is added to the intptr_t conversion which is removed when<br>
| converting back to the pointer type.<br>
<br>
</div>I am lost. Is this with all the implementations you have today for<br>
which you want operator< to be a total order?<br>
<div></div></blockquote></div><br>Nope. My contention has consistently been that platforms serviced by C++11 compilers today have totally ordered pointers with respect to operator<.</div><div class="gmail_extra">
<br></div><div class="gmail_extra">You are the one who used the words "exotic architecture" (see what I quoted above).</div><div class="gmail_extra"><br></div><div class="gmail_extra">On a system with 16-bit pointers, 16-bit unsigned shorts, 32 bit unsigned longs and 32-bit uintptr_t's, the following pseudocode is perfectly reasonable:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">uintptr_t cast(T* p) { static unsigned long salt; return ++salt << 16 | (unsigned short)p; }</div><div class="gmail_extra">T* cast(uintptr_t i) { return (T*)(unsigned short)p; }</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I see nothing in the standard which would make that pseudocode illegal.</div><div class="gmail_extra"><br clear="all"><div>If that isn't what you meant by "exotic architecture", please elaborate on what you do mean.</div>
-- <br> Nevin ":-)" Liber <mailto:<a href="mailto:nevin@eviloverlord.com" target="_blank">nevin@eviloverlord.com</a>> <a href="tel:%28847%29%20691-1404" value="+18476911404" target="_blank">(847) 691-1404</a>
</div></div>