[function] allocator_test breakage

Hello, a number of compilers (Intel, Acc, Cxx, Sun, Borland) currently have troubles compiling this test. All compilers are giving the same error message, namely that they can't convert from const functor_wrapper<...> to const counting_allocator<functor_wrapper<...> > & at boost/function/function_base.hpp:435 The test passes for me (using cxx 7.1) when applying the attached patch. I'm not really sure that this is the right fix, so could the someone please take a look, and possibly apply the patch if it's OK? Regards, Markus Index: function_base.hpp =================================================================== --- function_base.hpp (revision 46035) +++ function_base.hpp (working copy) @@ -432,7 +432,7 @@ // can't do the static_cast that we should do. const functor_wrapper_type* f = (const functor_wrapper_type*)(in_buffer.obj_ptr); - wrapper_allocator_type wrapper_allocator(static_cast<wrapper_allocator_type const &>(*f)); + wrapper_allocator_type wrapper_allocator(*f); wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1); wrapper_allocator.construct(copy, *f); @@ -443,7 +443,7 @@ /* Cast from the void pointer to the functor_wrapper_type */ functor_wrapper_type* victim = static_cast<functor_wrapper_type*>(in_buffer.obj_ptr); - wrapper_allocator_type wrapper_allocator(static_cast<wrapper_allocator_type const &>(*victim)); + wrapper_allocator_type wrapper_allocator(*victim); wrapper_allocator.destroy(victim); wrapper_allocator.deallocate(victim,1); out_buffer.obj_ptr = 0;
participants (1)
-
Markus Schöpflin