4 ms·
Granted, we've been presupposing C, but: In C++ you have a simple out by overloading T::operator&, allowing you to alter the result of the RHS of that equation
by MaulingMonkey 12y ago
Granted, we've been presupposing C, but:
In C++ you have a simple out by overloading T::operator&, allowing you to alter the result of the RHS of that equation and break it.
There's also a little bit in the standard prohibiting comparing pointers to different arrays - a leftover from the 16-bit era of near and far pointers I suspect - but that appears to only apply to relational comparisons in the C++11 standard:
http://stackoverflow.com/questions/9086372/how-to-compare-pointers/9086675#9086675 http://stackoverflow.com/questions/9086372/how-to-compare-po...
I either misremember this applying to == and != as well (likely), or this changed since the C++03 standard that I'm used to referencing (unlikely). I'm also unsure if C has an equivalent rule. A fun note from that SO link:
std::less<T*>
guarantees more than
operator<( T*, T* )
enabling
std::map<T*,...>
et all.
(edit: formatting)