list::unique() is an inbuilt function in C++ STL which removes all duplicate consecutive elements from the list. It works only on sorted list.
Parameters: The function accepts a single and optional parameter which is a binary predicate that returns true if the elements should be treated as equal. It has following syntax:
bool name(data_type a, data_type b);
Return value: This function does not return anything.
Below is the implementation of above function:
List is: 2.55 3.15 4.16 4.77 12.65 13.59 List is: 2.55 3.15 4.16 12.65 13.59