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

Forum statistics

Threads
474,261
Messages
2,571,041
Members
48,769
Latest member
Clifft

Latest Threads

Top