diff --git a/test/test_node_handling.cpp b/test/test_node_handling.cpp index d4562f9..2737629 100644 --- a/test/test_node_handling.cpp +++ b/test/test_node_handling.cpp @@ -419,12 +419,31 @@ struct enable_if_not_key_based:boost::enable_if_c< void* >{}; +/* Boost.Move C++03 perfect forwarding emulation converts non-const lvalue + * refs to const lvalue refs. final_forward undoes that. + */ + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + +template +T&& final_forward(typename boost::remove_reference::type& x) +{ + return static_cast(x); +} + +#else + +template +T& final_forward(const T& x){return const_cast(x);} + +#endif + template void merge( Dst& dst,BOOST_FWD_REF(Src) src, typename enable_if_key_based::type=0) { - dst.merge(boost::forward(src)); + dst.merge(final_forward(src)); } template @@ -432,7 +451,7 @@ void merge( Dst& dst,BOOST_FWD_REF(Src) src, typename enable_if_not_key_based::type=0) { - dst.splice(dst.end(),boost::forward(src)); + dst.splice(dst.end(),final_forward(src)); } template