On 25/03/2017 23:05, Christopher Pisz via Boost-users wrote:
What would be so wrong with category being an actual number to compare against?
I don't know anyone whom creates classes and operator == using the address of that class. You guys talk about the standard and what not, and admittedly I've never looked inside how they implement things, but I've never had such problems using the STL either.
C++ 14 standard subsection 19.5.1.1: "error_category objects are passed by reference, and two such objects are equal if they have the same address. This means that applications using custom error_category types should create a single object of each such type." Indeed subsection 19.5.1.3 explicitly says that the comparison operator returns (this == &rhs). That puts standard library implementators in a bind. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/