引用is_permutation: http://www.cplusplus.com/reference/algorithm/is_permutation/?kw=is_permutation Test whether range is permutation of another Compares the elements in the range [first1,last1) with those in the range beginning at first2, and returns t
Compares the elements in the range [first1,last1) with those in the range beginning at first2, and returns true if all of the elements in both ranges match, even in a different order.
The elements are compared using operator== or pred.
那您用STL全部用默认参数好了,方便快捷[/quote]
这人什么理解能力。我从来就没说只能传operator==。我说的只是抽象意义的==。你传进去的pred也必须满足==的语义。啥叫==,等价关系要满足自反对称传递三个性质,要是不懂啥是等价关系自己补习离散代数基础。
你自己贴的那个链接,自己看pred的描述:
The value returned indicates whether the elements are considered to match in the context of this function.
怪谁?[/quote]
不好意思,的确是我的问题,谢谢。
但是,我的确认为,您的==跟<表示都没带operator,我不认为我一开始把您的==理解成operator ==是有问题。而且恐怕您的回复语气从一开始就不太友善吧。
不过怎样,还是谢谢了!
Compares the elements in the range [first1,last1) with those in the range beginning at first2, and returns true if all of the elements in both ranges match, even in a different order.
The elements are compared using operator== or pred.
那您用STL全部用默认参数好了,方便快捷[/quote]
这人什么理解能力。我从来就没说只能传operator==。我说的只是抽象意义的==。你传进去的pred也必须满足==的语义。啥叫==,等价关系要满足自反对称传递三个性质,要是不懂啥是等价关系自己补习离散代数基础。
你自己贴的那个链接,自己看pred的描述:
The value returned indicates whether the elements are considered to match in the context of this function.
怪谁?
Compares the elements in the range [first1,last1) with those in the range beginning at first2, and returns true if all of the elements in both ranges match, even in a different order.
The elements are compared using operator== or pred.
那您用STL全部用默认参数好了,方便快捷