From 1774c0646d6cfd9eb81a967481c792c3590dc516 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 1 Feb 2002 02:51:48 +0000 Subject: [PATCH] function_template.hpp: - Handle compilers without void returns in a sensible manner [SVN r12615] --- include/boost/function/function_template.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index dfa35a7..fce2a94 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -248,7 +248,12 @@ namespace boost { typedef T0 first_argument_type; typedef T1 second_argument_type; #endif + +#ifndef BOOST_NO_VOID_RETURNS typedef R result_type; +#else + typedef internal_result_type result_type; +#endif // BOOST_NO_VOID_RETURNS typedef Policy policy_type; typedef Mixin mixin_type; typedef Allocator allocator_type; @@ -297,7 +302,11 @@ namespace boost { BOOST_FUNCTION_ARGS); policy.postcall(this); +#ifndef BOOST_NO_VOID_RETURNS return static_cast(result); +#else + return result; +#endif // BOOST_NO_VOID_RETURNS } // The distinction between when to use BOOST_FUNCTION_FUNCTION and