Is there a way to write a one line condition that would return true if STL container is sorted? The container in question is std::vector
I intend to use it in an assert<
It depends what STL data type you want to use.
A map is already sorted by the key provided the key has overloaded compare operators. You're good to go here.
A list requires that you explicitly call the sort function. You will need to keep track of whether or not you sorted it yet.
Hope this helps.