From c326d30f2875a21da60b476e331f39b779755abd Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 6 Nov 2016 14:43:42 +0200 Subject: [PATCH] Remove std::unary/binary_function use, they have been removed in C++17 --- include/boost/function/function_template.hpp | 11 ------ test/Jamfile.v2 | 2 + test/result_arg_types_test.cpp | 40 ++++++++++++++++++++ 3 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 test/result_arg_types_test.cpp diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 82c81d7..7984c83 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -656,17 +656,6 @@ namespace boost { BOOST_FUNCTION_TEMPLATE_PARMS > class BOOST_FUNCTION_FUNCTION : public function_base - -#if BOOST_FUNCTION_NUM_ARGS == 1 - - , public std::unary_function - -#elif BOOST_FUNCTION_NUM_ARGS == 2 - - , public std::binary_function - -#endif - { public: #ifndef BOOST_NO_VOID_RETURNS diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index f3f13c5..6f3cd0b 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -66,6 +66,8 @@ import testing ; [ run libs/function/test/rvalues_test.cpp : : : : ] [ compile libs/function/test/function_typeof_test.cpp ] + + [ run libs/function/test/result_arg_types_test.cpp ] ; } diff --git a/test/result_arg_types_test.cpp b/test/result_arg_types_test.cpp new file mode 100644 index 0000000..33ccddc --- /dev/null +++ b/test/result_arg_types_test.cpp @@ -0,0 +1,40 @@ +// Boost.Function library + +// Copyright 2016 Peter Dimov + +// Use, modification and distribution is subject to +// 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 +#include +#include + +struct X +{ +}; + +struct Y +{ +}; + +struct Z +{ +}; + +int main() +{ + typedef boost::function F1; + + BOOST_TEST_TRAIT_TRUE(( boost::core::is_same )); + BOOST_TEST_TRAIT_TRUE(( boost::core::is_same )); + + typedef boost::function F2; + + BOOST_TEST_TRAIT_TRUE(( boost::core::is_same )); + BOOST_TEST_TRAIT_TRUE(( boost::core::is_same )); + BOOST_TEST_TRAIT_TRUE(( boost::core::is_same )); + + return boost::report_errors(); +}