operator == - necessary for which STL algorithms?

S

Stephen Howe

Hi

operator < is necessary to use std::sort(), std::stable_sort(),
std::partial_sort(), std::inplace_merge(), std::equal_range(),
std::lower_bound(), std::upper_bound(), std::merge() (as well as set/
map/multiset/multimap, std::list.sort(), std::list.merge())

But which algorithms requires == operator?

I can think of adjacent_find(), find(), unique() - are there any more?

Is there any URL which lists them all?

Cheers and thanks

Stephen Howe
 
V

Victor Bazarov

operator< is necessary to use std::sort(), std::stable_sort(),
std::partial_sort(), std::inplace_merge(), std::equal_range(),
std::lower_bound(), std::upper_bound(), std::merge() (as well as set/
map/multiset/multimap, std::list.sort(), std::list.merge())

But which algorithms requires == operator?

I can think of adjacent_find(), find(), unique() - are there any more?

Is there any URL which lists them all?

Search for 'EqualityComparable'. You should find 'find', 'search_n',
'count', 'replace', 'replace_copy', 'remove'. Not sure what else.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top