A version of my previous post (a tidy, all-in-one table of all the C++03 container iterator invalidation rules) updated for C++0x.
A version of my previous post (a tidy, all-in-one table of all the C++03 container iterator invalidation rules) updated for C++0x.
I've not found a tidy, all-in-one table of all the C++03 container iterator invalidation rules. So, with references, here they are!
Tempted to count the passage of CPU time with the clock() POSIX call? Be careful.
Keeping it low-key this week, let's re-iterate (lol) the conventional map-erase idiom in C++.
In an unprecedented feat of miraculousness, Freenode's ##C++ discussion channel saw — in the space of no more than twenty minutes — the same question asked twice of one of C++'s more subtle features. Just how do you declare a friend
from the global namespace? I find out.
I briefly explore an odd case of misbehaviour from clang.
Right or wrong, it's still trendy in some C++ circles to use the singleton pattern for defining a type that can only be instantiated at most once in an execution run. However, this can cause problems when you bring more static data into the mix.
I ask everyone to stop using the erroneous term "STL".
One of the evilnesses of the C++ Standard Library is that implementations — be they GCC's libstdc++ or the Dimkumware implementation used by MSVC — are free to have their headers include other standard headers as much as they like. This can lead to confusion.
I briefly explore a common inheritance gotcha and its usual solution.