Find duplicate entries in STL algorithm

S

silverburgh.meryl

Hi,

Is there a STL algorithm which helps me in finding duplicate entries
from a list?
and it allows me to plug in a binary function as the match criteria?

Thank you.
 
V

Victor Bazarov

Is there a STL algorithm which helps me in finding duplicate entries
from a list?
and it allows me to plug in a binary function as the match criteria?

What book on Standard Library are you reading?

Create a copy of your list, sort it, then enumerate the elements and
count the adjacent equal elements using 'adjacent_find'. Example of
that (or something similar, anyway) is on page 354 of "TC++SL:TR".

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,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top