From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2003-08-30 21:58:07
David Abrahams wrote:
> Aleksey Gurtovoy <agurtovoy_at_[hidden]> writes:
> > E. Gladyshev wrote:
> >> > * Consider parametrization, especialy if your library is to be
> >> > for embedded or non-traditional (like DSP, etc.) platfroms.
> >> I think this item will make you think twice before hiding
> >> boost::signal's allocator.
> > An allocator parameter is not the only way to parameterize, here, nor it
> > necessarily the most appropriate one. If I wanted to manage how
> > function/signals allocate their memory, I wouldn't want to do it on a
> > per-object basis - which, without the typedef templates, is pretty much
> > only level the allocator template parameter would allow me to manage it
> > At least for these two libraries, a per-project parameterization seems
> > appropriate to the real needs, and something as simple as a trait class
> > could provide the means.
> ?? Because of its rebind<...>, allocators *are* essentially poor man's
> typedef templates (i.e. metafunction classes)...
What I meant is that, for function/signals in particular, with the allocator
template parameter and without typedef templates you would be forced to do
per-object selection of the memory management strategy (since you cannot
typedef 'boost::function<F,my_allocator>' to 'my::function<F>') - which is
usually not what you want/need.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk