Work around Visual C++ copy constructor bug. Fixes #2929.

Based on the patch by Steven Watanabe.

[SVN r54619]
This commit is contained in:
Daniel James
2009-07-03 22:22:03 +00:00
parent ae534d7342
commit 8b63c146ea
2 changed files with 10 additions and 0 deletions

View File

@ -262,6 +262,12 @@ namespace boost {
A(a)
{
}
functor_wrapper(const functor_wrapper& f) :
F(static_cast<const F&>(f)),
A(static_cast<const A&>(f))
{
}
};
/**

View File

@ -128,6 +128,10 @@ test_main(int, char*[])
BOOST_CHECK(dealloc_count == 0);
fv.assign( &do_nothing, std::allocator<int>() );
fv.clear();
function0<void> fv2;
fv.assign(&do_nothing, std::allocator<int>() );
fv2.assign(fv, std::allocator<int>() );
return 0;
}