What about doing something like this: #ifdef DEBUG template <> struct std::default_alloc< std::vector< bool > > {}; #endif It should (modulo my typos) make allocation of all vector<bool> impossible in the debug builds. Just an idea. Cheers, Gabor