diff --git a/test/functional/invoke.cpp b/test/functional/invoke.cpp index d6d03ddf..67e65feb 100644 --- a/test/functional/invoke.cpp +++ b/test/functional/invoke.cpp @@ -10,6 +10,10 @@ #include #include +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#include +#endif + #include #include @@ -371,7 +375,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); diff --git a/test/functional/invoke_function_object.cpp b/test/functional/invoke_function_object.cpp index 7cbe6e59..d618a495 100644 --- a/test/functional/invoke_function_object.cpp +++ b/test/functional/invoke_function_object.cpp @@ -10,6 +10,10 @@ #include #include +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#include +#endif + #include #include @@ -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); diff --git a/test/functional/invoke_procedure.cpp b/test/functional/invoke_procedure.cpp index f8db06cc..49c35d37 100644 --- a/test/functional/invoke_procedure.cpp +++ b/test/functional/invoke_procedure.cpp @@ -10,6 +10,10 @@ #include #include +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#include +#endif + #include #include @@ -256,8 +260,19 @@ int main() vector0 v0; vector1 v1(element1); + +#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. + + vector2 v2(std::ref(element1), element2); + vector3 v3(std::ref(element1), element2, std::ref(element3)); +#else vector2 v2(element1, element2); vector3 v3(element1, element2, element3); +#endif test_sequence(v0); test_sequence(v1); diff --git a/test/sequence/value_at.hpp b/test/sequence/value_at.hpp index 9fe3a198..ae03dd3c 100644 --- a/test/sequence/value_at.hpp +++ b/test/sequence/value_at.hpp @@ -2,7 +2,7 @@ Copyright (c) 1999-2003 Jaakko Jarvi Copyright (c) 2001-2011 Joel de Guzman - Distributed under the Boost Software License, Version 1.0. (See accompanying + Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #include @@ -11,6 +11,10 @@ #include #include +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#include +#endif + #if !defined(FUSION_AT) #define FUSION_AT at_c #endif @@ -35,7 +39,16 @@ test() double d = 2.7; A a; +#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. + + FUSION_SEQUENCE t(1, std::ref(d), a, 2); +#else FUSION_SEQUENCE t(1, d, a, 2); +#endif const FUSION_SEQUENCE ct(t); int i = FUSION_AT<0>(t); @@ -66,7 +79,7 @@ test() ++FUSION_AT<0>(t); BOOST_TEST(FUSION_AT<0>(t) == 6); - + typedef FUSION_SEQUENCE seq_type; BOOST_STATIC_ASSERT(!(