>>>> leading to completely unnecessary O(N) operations (racall that size() is >>>> O(N) for a map or a list). >>>> >>> While true for a list, it is not a problem for maps or sets: >> >> http://gcc.gnu.org/onlinedocs/libstdc++/manual/containers.html#sequences.list.size > > Yet another reason I hate gcc. Â Anywho the foo.empty() is better anyway as > it does represent the idea.
Gcc's list has O(1) size() in c++11 mode (it's mandated for all containers by the C++11 standard). Just for information, I have no opinion on the change. (but I do hope everybody switches to c++11 soon, just for "auto") -j. _______________________________________________ Mailing list: https://launchpad.net/~dolfin Post to : dolfin@lists.launchpad.net Unsubscribe : https://launchpad.net/~dolfin More help : https://help.launchpad.net/ListHelp