forked from boostorg/function
Remove std::unary/binary_function use, they have been removed in C++17
This commit is contained in:
@ -656,17 +656,6 @@ namespace boost {
|
|||||||
BOOST_FUNCTION_TEMPLATE_PARMS
|
BOOST_FUNCTION_TEMPLATE_PARMS
|
||||||
>
|
>
|
||||||
class BOOST_FUNCTION_FUNCTION : public function_base
|
class BOOST_FUNCTION_FUNCTION : public function_base
|
||||||
|
|
||||||
#if BOOST_FUNCTION_NUM_ARGS == 1
|
|
||||||
|
|
||||||
, public std::unary_function<T0,R>
|
|
||||||
|
|
||||||
#elif BOOST_FUNCTION_NUM_ARGS == 2
|
|
||||||
|
|
||||||
, public std::binary_function<T0,T1,R>
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#ifndef BOOST_NO_VOID_RETURNS
|
#ifndef BOOST_NO_VOID_RETURNS
|
||||||
|
@ -66,6 +66,8 @@ import testing ;
|
|||||||
[ run libs/function/test/rvalues_test.cpp : : : : ]
|
[ run libs/function/test/rvalues_test.cpp : : : : ]
|
||||||
|
|
||||||
[ compile libs/function/test/function_typeof_test.cpp ]
|
[ compile libs/function/test/function_typeof_test.cpp ]
|
||||||
|
|
||||||
|
[ run libs/function/test/result_arg_types_test.cpp ]
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
40
test/result_arg_types_test.cpp
Normal file
40
test/result_arg_types_test.cpp
Normal file
@ -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 <boost/function.hpp>
|
||||||
|
#include <boost/core/is_same.hpp>
|
||||||
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
|
|
||||||
|
struct X
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Y
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Z
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
typedef boost::function<X(Y)> F1;
|
||||||
|
|
||||||
|
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F1::result_type, X> ));
|
||||||
|
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F1::argument_type, Y> ));
|
||||||
|
|
||||||
|
typedef boost::function<X(Y, Z)> F2;
|
||||||
|
|
||||||
|
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::result_type, X> ));
|
||||||
|
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::first_argument_type, Y> ));
|
||||||
|
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::second_argument_type, Z> ));
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
Reference in New Issue
Block a user