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<
You can use std::is_sorted(vec.begin(),vec.end()) to test if it is sorted. Note, though, that this is O(n).