Mws wrote: >hi, > >why is the std::vector member function pop_back() not checking for >validity? >is this wanted behaviour or a bug? > > > There isn't a check, to ensure maximum possible performance. If you want to enable checking, you should compile using the flag: -D_GLIBCXX_DEBUG Which turns on lots of checks, including this one, at the obvious cost of slight slowness, and also checks a bunch of other things as well. note you have to recompile your whole program using this flag, as it makes the various stl containers a slightly larger size, to hold the debugging information, so you can't link debugging and non-debugging code (well, you can in some cases, if you are really careful, but in general you just shouldn't). Chris