Category: std::list
C++ : How to reverse a List or sub-list in place?
In this article we will discuss how to discuss different ways to reverse a complete std::list or a sub list inside a list. Suppose we have a list of strings i.e. Advertisements std::list<std::string> listOfStrs = { “is”, “of”, “the”, “Hi”, “Hello”, “from” }; Now we want to reverse it i.e. from , Hello , Hi …
C++ : How to copy / clone a STL List or Sub List
In this article we will discuss different techniques to clone the whole list or copy just a sub list. Suppose we have a std::list of strings i.e. Advertisements // List of strings std::list<std::string> listOfStrs = { “of”, “is”, “from”, “this”, “at”, “to” }; Now let’s see how to copy this or a sub list from …