http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58562
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- Specifically it fails this requirement: matrixVectorProdTerm a(1, 0, 0); matrixVectorProdTerm b(0, 1, 0); assert( !(a<b && b<a) ); i.e. with your definition of ordering two objects can both be less than each other, which makes the ordering unsuitable for std::sort (or pretty much anything else in the standard library that cares about sorting.)