Boost logo

Boost :

Subject: [boost] [BGL] container_gen (was Re: [tree] reviving the tree library)
From: Cromwell Enage (sponage_at_[hidden])
Date: 2011-05-09 10:36:16

--- On Fri, 5/6/11, Erik Erlandson wrote:
> My storage models are effectively wrappers around the
> underlying containers (the container is a member of
> the node type). I originally thought it would be nice
> to allow a user to somehow drop in any container they
> wanted, but I was unable to find a way to make that
> work properly.


> Perhaps container_gen would allow it to be more fully
> automated.

The idea behind container_gen is indeed to allow users to drop in containers of their choosing by providing their own specializations and selectors. In turn, your node class template needs only to take in the selector type as an additional template parameter.

One current limitation that may be important to you is the inability to supply custom allocators as well. I saw in the sandbox that the BGL authors were planning to provide selector templates parameterized by allocator type. I'm wondering how that work is progressing.

At any rate, to the BGL authors: I find container_gen to be a useful utility metafunction outside its current home. Would anyone else like to see it become a first-class Boost citizen?

Cromwell D. Enage

Boost list run by bdawes at, gregod at, cpdaniel at, john at