C++ List unique()Last Updated : 17 Mar 2025 C++ List unique() function removes all the duplicate elements present consecutively from the list. SyntaxParameterpred: It is a binary predicate that takes two values of same type. It returns true, if both the values are equal otherwise false. Syntax of the predicate function would be:Return valueIt does not return any value. Example 1Let's see a simple example Output: java Example 2Let's see a simple example when predicate function is passed to the parameter. Output: 12 ,13.1,14.7,15.5 Next Topicresize() Function |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India