This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: debug extension overhead


On Wed, May 20, 2009 at 04:54:28PM -0700, Jonathan Wakely wrote:
> 2009/5/21 Jonathan Wakely:
> >
> > If you explicitly change a single container to be a
> > __gnu_debug::vector instead of std::vector (as above, *not* by
> > defining _GLIBCXX_DEBUG) then you're using a distinct type and will
> > get a compile-time or link-time failure.  To resolve that you "only"
> > have to recompile everything that is affected by the change in type,
> > just as you would if you changed MyClass::list_type from a vector to a
> > deque.
> 
> ... assuming you consistently use a typedef for the affected
> container. Otherwise you might need to change loads of code that says
> e.g. std::vector<int>::iterator, rather than
> MyClass::list_type::iterator.

Yes, it's too bad we can't time-travel back a few years and put in
the new "auto" feature at the same time that the STL went in, so
the compiler can pick the right iterator types.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]