I just wonder how expensive is it to call a std::list size(). Some people say it's an O(1) call because the size is updated upon insert() or remove()/erase(). Some people say it will iterate from begin to end and count how many elements are there.
Does c++ standard say anything about how the complexity of this function call should be? Thanks!