Re: [boost] Please don't define a fake "operator <" justfor ordered containers

No. For pointers going into the same array segment (including one-past-end) or the same access-level class block, operator "<" is defined. Using the operator is unspecified if the pointers are from different spans. The "std::less<T*>" specializations have to give the same results as the operator when the operator is defined, but must give a total ordering so pointers from different spans (or NULL) can be compared. Due to potential exclusivities in comparison domains, it's possible that the operator and the class template use separate definitions.
I must leave it in your capable hands to provide a summary and solution for this thread. It would be very interesting.

"Sohail Somani" <s.somani@fincad.com> writes:
No. For pointers going into the same array segment (including one-past-end) or the same access-level class block, operator "<" is defined. Using the operator is unspecified if the pointers are from different spans. The "std::less<T*>" specializations have to give the same results as the operator when the operator is defined, but must give a total ordering so pointers from different spans (or NULL) can be compared. Due to potential exclusivities in comparison domains, it's possible that the operator and the class template use separate definitions.
I must leave it in your capable hands to provide a summary and solution for this thread. It would be very interesting.
...particularly when your mailer doesn't insert the References: header that allows for proper threading. I can't tell to whom you're responding. -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
David Abrahams
-
Sohail Somani