From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2007-06-05 12:42:37
> On Jun 4, 2007, at 10:57 PM, Emil Dotchevski wrote:> > One important advantage of using boost::function is that it acts > > like a> > function pointer, reducing physical coupling between compilation > > units. This> > is very much like shared_ptr.> >> > A nice feature of shared_ptr is that it has a single template > > parameter, T,> > even though diferent instances of shared_ptr<T> can use different> > allocators.> >> > When using boost::function, one can also provide an allocator, but > > unlike> > shared_ptr, the allocator is a default parameter of the > > boost::function> > class template.> > > Is there a reason why this is necessary? Can't boost::function use > > similar> > technique to the one employed by shared_ptr to avoid the need for this> > second template parameter?> > You know, I never even thought about adding it. I didn't know about > the shared_ptr technique when I put the allocator into > boost::function, and after the C++ committee removed the allocator I > didn't think about it any more.
Perhaps if the allocator it's moved to the constructor, the committee would accept it? :)
> <snip>> I don't know when I would have time to implement this, although I > would certainly consider adding this functionality to Boost's > "function". Might you be interested in implementing it?
OK, I'll give it a shot, and I'll let you know how it goes.
Live Earth is coming. Learn more about the hottest summer event - only on MSN.