Suppose I'm trying to insert random stuff on a list in CPP using include list,
list <string> newList;
list<string>::iterator z = newList.begin();
//James(Remains static, rest sorted) -> Abraham-> Brian-> Chuck-> David-> Rick-> Morty
newList.insert(z,James);
newList.insert(z,David);
newList.insert(z, Rick);
newList.insert(z, Abraham);
newList.insert(z, Brian);
newList.insert(z, Morty);
newList.insert(z, Chuck);
how, and where do I call the newList.sort() to make all of them sorted except the first insertion, ie James?