标签:http io os sp on bs amp as tt
如果编写的判断式不满足strict weak ordering,就会出现Invalid operator< assertion error错误。网页:http://support.microsoft.com/kb/949171
VS(其他编译器还没试过)中,sort函数要求比较函数是strict weak ordering的,而strict weak ordering必须满足三个条件:
1) Strict: pred (X, X) is always false. X跟X自己比为false
2) Weak: If ! pred (X, Y) && !pred (Y, X), X==Y. 当X<Y和Y<X都不成立时,X等于Y
3)Ordering: If pred (X, Y) && pred (Y, Z), then pred (X, Z). 当X<Y,Y<Z时,X<Z成立,即排序的一个传递性。
Invalid operator< assertion error解析
标签:http io os sp on bs amp as tt
原文地址:http://www.cnblogs.com/lakeone/p/4148656.html