Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
Flags
safe-html, strict-same
Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
predicates, especially if you're using a function pointer. If you compare two containers with different equality predicates then the result is undefined. For most stateless function objects this is impossible - since you can only compare objects with the same equality predicate you know the equality predicates must be equal. But if you're using function pointers or a stateful equality predicate (e.g. `boost::function`) then you can get into trouble.在使用自定义相等谓词(特别是函数指针)时请务必小心。如果你用不同的相等谓词比较两个容器,结果是未定义的。对于大多数无状态函数对象而言,这种情况不可能发生——因为你只能使用相同的相等谓词来比较对象,所以两个相等谓词必然相等。但如果你使用的是函数指针或有状态的相等谓词(例如 boost::function),则可能会遇到问题。