The C++ standard said Container::size() should have constant complexity (ISO/IEC 14882:1998, pp. 461, Table 65), while the std::list::size() in current STL of GCC is defined as { std::distance(begin(), end()); }, whose complexiy is O(n). Is it a bug?
- [C++] Should the complexity of std::list::size() be O(n) o... 聂久焘
- Re: [C++] Should the complexity of std::list::size() ... chris jefferson
- Re: [C++] Should the complexity of std::list::size() ... Phil Edwards
- Re: [C++] Should the complexity of std::list::siz... Howard Hinnant
- Re: [C++] Should the complexity of std::list:... Phil Edwards