Boost logo

Boost :

From: Phil Bouchard (philippe_at_[hidden])
Date: 2008-06-05 12:04:55


Hi,

Firstly after defining my own sh::pool allocator new doors opened on their
own and now I am able to replace the "new_sh<>()" function call with a much
more neat C++ approach with "new shifted<>()". For example instead of:

shifted_ptr<char[9]> u = new_sh<char[9]>();

Now we can write:
shifted_ptr<char[9]> u = new shifted<char[9]>();

This will allows us defining STL container allocators more easily because of
the distinct steps the constructor and allocator are called; new_sh<>() was
mixing them altogether.

Secondly I was able to drastically clean up "class shifted<>" (was: owned<>)
by unifying the construction of the member object with the construction of
the class itself. This was necessary to use "new shifted<>()" adequately.

Last but not least the library now takes advantage of the
fast_pool_allocator for objects such as "struct set" and
"numeric::interval<int>". FYI I am using "numeric::interval<int>" instead
of "numeric::interval<void *>" because of a compilation failure with the
latter. I am casting the pointers to an "int" meanwhile because there is no
lost of information by doing so according to the standards.

The files are both on Vault and the Sandbox and is nearly the official
release. Documentation will follow soon for those who got no clue what I'm
talking about:
http://www.boost-consulting.com/vault/index.php?action=downloadfile&filename=shifted_ptr.zip&directory=Memory

Thanks,
-Phil


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