Re: Why does the [] operator in vector behave as it does?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 30, 2008 at 11:32 AM, Luke Dickens <lwd03@xxxxxxxxxxxx> wrote:
>  I was going to look at smart pointers when I did a code clean-up. I have
> the boost libraries, but don't want to introduce too much new code all at
> once. Are they fairly easy to incorporate into existing code, or is this too
> pervasive a coding paradigm requiring an entire rework.
>

They're very much libraries, not a framework, so you can easily ignore
large parts. (Wave and spirit, for example.)

Also, of particular interest might be the Boost Pointer Containers
library.  A boost::ptr_vector<T> is internally a std::vector<T*>, so
it doesn't need copy constructability or assignability of A, with a
helpful interface that calls delete on the pointers before erasing
them from the container and has most of the interface look like a
sequence of T, so you don't need to add extra indirections to
iterators and such.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux