Boost logo

Boost :

Subject: Re: [boost] [function] "paranoia" vs efficiency
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2009-11-07 15:04:12

On Wed, Oct 28, 2009 at 5:34 PM, Domagoj Saric <dsaritz_at_[hidden]> wrote:
>> And I *love* the idea about using a nop static func that throws, or
>> perhaps asserts, all depending on policy settings for example.  :)
> it is..."and more" ;-)

I'd love to see some of these improvements to boost::function.
In particular, I'd like to be able to configure the size of the small
buffer optimization.
Of course, I'd also like it to still be compatible with function<>s of
other sizes.


boost::function<void (int), 16 > func16 = ...;
boost::function<void (int), 12 > func12;

func12 = func16; // need this to still work (ie operator= needs to be
templatized on sbo size)

Some of the other changes looked interesting as well.

I do understand the rational of a single, simple shared_ptr<>, and
that this might also apply to function<>. But I would think that
templatized copy constructors, etc, could make all the
boost::functions compatible with each other, regardless of policy. I


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