
On Mon, Oct 11, 2010 at 7:49 AM, Domagoj Saric <domagoj.saric@littleendian.com> wrote:
"Emil Dotchevski" <emil@revergestudios.com> wrote in message news:AANLkTin=9rdwNqHQZRAPj9=9YngdTD0mX7zQ8S1LmhQm@mail.gmail.com...
On Sat, Oct 9, 2010 at 12:38 PM, Daniel Walker <daniel.j.walker@gmail.com> wrote:
Finally, there have been suggestions to alter boost::function's exception safety guarantee directly through either policies or constructor options.
We used to have an Allocator parameter to the boost::function template and it was removed (just in time for this change to also be reflected in C++0x) to reduce coupling. Adding any policies to boost::function would undo all of the benefits of that change.
What (de)coupling (and the related benefits) are you referring to? The ABI compatibility/stability and safe cross .DLL/.so passing arguments also used for the justification of the hardcoded dynamic deleter in shared_ptr or something else?
Yes, that ability is a result of the reduced coupling. One of the main objectives of boost::function is type erasure: being able to hold on to functions without knowing their exact type, and the allocator policy directly interfered with that. Also, with the removal of the default Allocator parameter of the main boost::function template, it is possible to define APIs in terms of boost::function without including boost/function.hpp; just a declaration in the API header suffices: namespace boost { template <class> function; } void foo( boost::function<void()> const & ); Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode