Should std::list::size have constant complexity in C++11?

谁说胖子不能爱 提交于 2019-11-28 13:20:55

This is not exactly a bug and you can read about it here:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49561

It's more of a case of compatibility with older versions of gcc. Looks like they really don't want to add an additional "data member".

Quoting:

This patch made c++98 and c++11 code incompatible and is causing serious problems for distros.

Where the patch is the fix they implemented for gcc 4.7 (it was O(1) in it).

Another quote:

maintaining ABI compatibility has been decided to be more important for the current releases

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!