Boost logo

Boost :

Subject: Re: [boost] Interest check: container with preallocated buffer
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-05-19 17:21:59


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 19 May 2009, Thorsten Ottosen wrote:
> I wonder if not the majority of the use cases falls into local
> objects. In that case, we should be able to use a special
> stack_based_allocator with existing containers.

I've read the c++03 standard containers aren't required to use the same
allocator object (or even a copy of the same object) to allocate and
deallocate a particular piece of memory. In practice, it seems most
implementations do. But I believe they are for example allowed to default
construct a temporary allocator to allocate a chunk of memory, then use a
different temporary allocator later to deallocate the same chunk of memory.

The c++0x container/allocator concepts look a lot fancier though. I imagine
they make it possible to make a fully conforming stack_based_allocator that
can be used with the standard containers.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkoTIvcACgkQ5vihyNWuA4XmiQCeLTCRfZl+X+6YwmLlj4fQTaKk
+5sAoMARqdauys3OFHCcc1w+6Xwatjax
=4cM0
-----END PGP SIGNATURE-----


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