|
Boost : |
From: Dan Rosen (dan.rosen_at_[hidden])
Date: 2005-03-24 11:34:48
Hi Ion,
Thanks for the input. It certainly doesn't hurt to respect allocator
typedefs and use the construct() member as intended. It just seems
that Google doesn't realize this yet :) However I did manage to find
this:
http://www.cuj.com/documents/s=8000/cujcexp1812austern
It seems like using allocators properly does impose some real design
decisions and restrictions. I think I'll study the Dinkumware STL
implementation (and also the Boost Graph Library) to see what they do,
since as far as I can tell, my code here is illegal:
class node_t;
typedef typename A::template rebind<node_t>::other node_allocator;
typedef typename node_allocator::value_type node;
typedef typename node_allocator::pointer node_pointer;
class node_t {
pointer t_;
node_pointer parent_;
// etc.
};
because I'm instantiating node_allocator with an incomplete type. Such
a strange dance this is.
Thanks again,
dr
On Thu, 24 Mar 2005 10:02:10 +0100, Ion Gaztañaga <ion_g_m_at_[hidden]> wrote:
> In my opinion, since it does not hurt, if you respect allocator typedefs and
> functions, you can get some advantages.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk