Workaround for some tests on C++11 to allow disambiguation of && and const& arguments to ctors

[SVN r82631]
This commit is contained in:
Joel de Guzman
2013-01-27 10:14:16 +00:00
parent b7d02a8c55
commit 6c17c04ce6
4 changed files with 58 additions and 2 deletions

View File

@ -10,6 +10,10 @@
#include <boost/fusion/functional/invocation/invoke_function_object.hpp>
#include <boost/detail/lightweight_test.hpp>
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#include <functional>
#endif
#include <boost/type_traits/is_same.hpp>
#include <memory>
@ -209,7 +213,17 @@ int main()
vector0 v0;
vector1 v1(element1);
vector2 v2(element1, element2);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
// Note: C++11 will pickup the rvalue overload for the d argument
// since we do not have all permutations (expensive!) for all const&
// and && arguments. We either have all && or all const& arguments only.
// For that matter, use std::ref to disambiguate the call.
vector3 v3(element1, element2, std::ref(element3));
#else
vector3 v3(element1, element2, element3);
#endif
test_sequence(v0);
test_sequence(v1);