mirror of
https://github.com/boostorg/function.git
synced 2025-07-23 17:37:14 +02:00
function_template.hpp:
- Make functionN<void, ...> really have a void return value [SVN r12613]
This commit is contained in:
@ -236,6 +236,9 @@ namespace boost {
|
|||||||
>
|
>
|
||||||
class BOOST_FUNCTION_FUNCTION : public function_base, public Mixin
|
class BOOST_FUNCTION_FUNCTION : public function_base, public Mixin
|
||||||
{
|
{
|
||||||
|
typedef typename detail::function::function_return_type<R>::type
|
||||||
|
internal_result_type;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BOOST_STATIC_CONSTANT(int, args = BOOST_FUNCTION_NUM_ARGS);
|
BOOST_STATIC_CONSTANT(int, args = BOOST_FUNCTION_NUM_ARGS);
|
||||||
|
|
||||||
@ -245,8 +248,7 @@ namespace boost {
|
|||||||
typedef T0 first_argument_type;
|
typedef T0 first_argument_type;
|
||||||
typedef T1 second_argument_type;
|
typedef T1 second_argument_type;
|
||||||
#endif
|
#endif
|
||||||
typedef typename detail::function::function_return_type<R>::type
|
typedef R result_type;
|
||||||
result_type;
|
|
||||||
typedef Policy policy_type;
|
typedef Policy policy_type;
|
||||||
typedef Mixin mixin_type;
|
typedef Mixin mixin_type;
|
||||||
typedef Allocator allocator_type;
|
typedef Allocator allocator_type;
|
||||||
@ -290,11 +292,12 @@ namespace boost {
|
|||||||
policy_type policy;
|
policy_type policy;
|
||||||
policy.precall(this);
|
policy.precall(this);
|
||||||
|
|
||||||
result_type result = invoker(function_base::functor BOOST_FUNCTION_COMMA
|
internal_result_type result = invoker(function_base::functor
|
||||||
BOOST_FUNCTION_ARGS);
|
BOOST_FUNCTION_COMMA
|
||||||
|
BOOST_FUNCTION_ARGS);
|
||||||
|
|
||||||
policy.postcall(this);
|
policy.postcall(this);
|
||||||
return result;
|
return static_cast<result_type>(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The distinction between when to use BOOST_FUNCTION_FUNCTION and
|
// The distinction between when to use BOOST_FUNCTION_FUNCTION and
|
||||||
@ -465,9 +468,9 @@ namespace boost {
|
|||||||
function_base::functor = detail::function::any_pointer(this);
|
function_base::functor = detail::function::any_pointer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef result_type (*invoker_type)(detail::function::any_pointer
|
typedef internal_result_type (*invoker_type)(detail::function::any_pointer
|
||||||
BOOST_FUNCTION_COMMA
|
BOOST_FUNCTION_COMMA
|
||||||
BOOST_FUNCTION_TEMPLATE_ARGS);
|
BOOST_FUNCTION_TEMPLATE_ARGS);
|
||||||
|
|
||||||
invoker_type invoker;
|
invoker_type invoker;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user