STL vector

Mws mws@twisted-brains.org
Thu Nov 3 16:25:00 GMT 2005


On Thursday 03 November 2005 16:49, random@bubblescope.net wrote:
> Mws wrote:
> 
> >On Tuesday 01 November 2005 11:01, Dima Sorkin wrote:
> >  
> >
> >>>i'll think i'll implement my own templates for the std::<classes> with
> >>>extended safety.
> >>>      
> >>>
> >> Before you do it, try debug mode of STLport (www.stlport.org).
> >>It is almost paranoidal mode, it checks things you could not even
> >>fantasize about.
> >>
> >>Regards,
> >> Dima.
> >>
> >>    
> >>
> >yes, i downloaded it and had a look at the source:
> >
> >  void pop_back() {
> >    --this->_M_finish;
> >    _Destroy(this->_M_finish);
> >  }
> >
> >the same unchecked stuff :)
> >
> >  
> >
> Just to point it out, if you check the debugging version (it lives in
> debug/vector), the function looks like:
> 
> void
> pop_back()
>       {
>         __glibcxx_check_nonempty();
>         iterator __victim = end() - 1;
>         __victim._M_invalidate();
>         _Base::pop_back();
>       }
> 
> Some nice checking there :)
yes, sounds to be a solution. i will try out and see if a glibc/libcstd++ combination including
the debug stuff is able to run on an embedded system with limited resources. e.g. 32 mb ram.

regards marcel



More information about the Gcc-help mailing list