diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 289f5b6..dd69848 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -21,11 +21,7 @@ #define BOOST_FUNCTION_TEMPLATE_PARMS typename... T #define BOOST_FUNCTION_TEMPLATE_ARGS T... #define BOOST_FUNCTION_PARMS T... a -#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES -# define BOOST_FUNCTION_ARGS a... -#else -# define BOOST_FUNCTION_ARGS static_cast(a)... -#endif +#define BOOST_FUNCTION_ARGS static_cast(a)... // Always have commas (zero args case is handled with variadics too) #define BOOST_FUNCTION_COMMA , @@ -710,12 +706,10 @@ namespace boost { this->assign_to_own(f); } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES BOOST_FUNCTION_FUNCTION(BOOST_FUNCTION_FUNCTION&& f) : function_base() { this->move_assign(f); } -#endif ~BOOST_FUNCTION_FUNCTION() { clear(); } @@ -785,7 +779,6 @@ namespace boost { return *this; } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES // Move assignment from another BOOST_FUNCTION_FUNCTION BOOST_FUNCTION_FUNCTION& operator=(BOOST_FUNCTION_FUNCTION&& f) { @@ -802,7 +795,6 @@ namespace boost { BOOST_CATCH_END return *this; } -#endif void swap(BOOST_FUNCTION_FUNCTION& other) { @@ -1061,11 +1053,9 @@ public: function(const base_type& f) : base_type(static_cast(f)){} -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES // Move constructors function(self_type&& f): base_type(static_cast(f)){} function(base_type&& f): base_type(static_cast(f)){} -#endif self_type& operator=(const self_type& f) { @@ -1073,13 +1063,11 @@ public: return *this; } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES self_type& operator=(self_type&& f) { self_type(static_cast(f)).swap(*this); return *this; } -#endif template typename boost::enable_if_< @@ -1103,13 +1091,11 @@ public: return *this; } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES self_type& operator=(base_type&& f) { self_type(static_cast(f)).swap(*this); return *this; } -#endif }; #undef BOOST_FUNCTION_PARTIAL_SPEC diff --git a/test/function_test.cpp b/test/function_test.cpp index 7592837..03d6fe0 100644 --- a/test/function_test.cpp +++ b/test/function_test.cpp @@ -754,7 +754,6 @@ static void test_move_semantics() BOOST_CHECK(!f1.empty()); BOOST_CHECK(global_int == 1); -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES // Testing rvalue constructors f1_type f2(static_cast(f1)); BOOST_CHECK(f1.empty()); @@ -796,8 +795,6 @@ static void test_move_semantics() BOOST_CHECK(global_int == 5); f4 = static_cast(f5); BOOST_CHECK(global_int == 4); - -#endif } int main() diff --git a/test/rvalues_test.cpp b/test/rvalues_test.cpp index 28545d5..0d21ec4 100644 --- a/test/rvalues_test.cpp +++ b/test/rvalues_test.cpp @@ -59,10 +59,8 @@ struct sum_struct { } }; -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES int three(std::string&&) { return 1; } std::string&& four(std::string&& s) { return boost::move(s); } -#endif int main() { @@ -95,13 +93,11 @@ int main() BOOST_CHECK(om2_sum_2.get_value() == 3); } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES function f3 = three; function f4 = four; f3(std::string("Hello")); BOOST_CHECK(f4(std::string("world")) == "world"); -#endif return boost::report_errors(); }