Possible solution
Possible solution
Posted Oct 28, 2024 2:45 UTC (Mon) by ianmcc (subscriber, #88379)In reply to: Possible solution by NYKevin
Parent article: realloc() and the oversize importance of zero-size objects
In C++, p < q is undefined behavior for unrelated pointers p,q. But std::less<T*>(p,q) is well-defined, and must give a strict total ordering. Gcc had a bug on this, since fixed: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78420