• Some implementations of std::list::size() have linear complexity rather than constant complexity. This latitude is allowed by the Standard container requirements specified in §IS-23.1. Calling such a function inside a loop would result in quadratic behavior. For the same reason it is better to use constructs such as if(myList.empty()) rather than if(MyList.size()==0).