Boost logo

Boost :

From: Phil Bouchard (philippe_at_[hidden])
Date: 2008-06-24 03:12:44


"Larry Evans" <cppljevans_at_[hidden]> wrote in message
news:g3liss$ubd$1_at_ger.gmane.org...

[...]

> Ah! Looking at the api doc:
>
> <root>/libs/smart_ptr/doc/api/index.html
>
> I'd guess that the ref_count is in boost::sh::detail::owned_base
> along with some other data having something to do with the
> 'Memory segment' mentioned in section 3.3 of:
>
> <root>/libs/smart_ptr/doc/index.html

Precisely, owned_base derives from sp_counted_base which contains the
counter.

[...]

> Why not use the forwarding library that was recently approved?
> A relevant post is:
>
> http://lists.boost.org/Archives/boost/2007/12/131699.php

Thanks I will; I am aware of the moving semantics on their way up the
standards I just need to have all the code exposed while working on the
allocator before using anything else.

[...]

> namespace container_intern
>
> actually rewrite std::vector to use a new defintion of std::allocator
> template which provided different pointer types. One type was for
> the root pointer of the container, the other was for all other
> pointers used in the container. The default value of std::allocator
> simply made root_pointer the same as pointer. The specialized
> version of std::allocator made the root_pointer a smart_pointer.
>
> Obviously the 2nd one would be very hard (or at least take very
> long) to get into the standard.

How fortunate! I could get use of that code... On the other hand
shifted_ptr is done and STL containers support is extracurricular so I would
vote for the latter. It can take all the time at that level, but we are
simply requiring lessening the standards...

-Phil


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk