C++ List unique()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
|