in order to get the unique elements in a list we can first sort the list in order to get the adjacent unique elements.....and then use unique function.
forward_list::unique( ) is a function in c++ standard library function which is used to remove the all duplicate (**adjacent**) elements from forward list. Notice that an element is only removed from the forward_list container if it compares equal to the element immediately it. Thus, this function is especially useful for sorted lists.
Hi! 😁 It was very helpful. I hardly considered forward lists for use, but they can be helpful and they're STL! Thank you, it was quick and to the point overview of its methods. 😊
I'd also add a link in the description for your previous video on emplace which you mention at 4:00, it was hell useful and it'd be easier to reference this way or putting the link directly in the video if it's not too much troublesome.
Here x{x} meaning there is x data member in your class and you are initializing that data member with variable x. Search initializer list in c++. You will get it.