Update of /cvsroot/boost/boost/boost/utility
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29712/boost/utility
Modified Files:
result_of.hpp
Log Message:
Fix result_of's handling of F(void).
Index: result_of.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/utility/result_of.hpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- result_of.hpp 24 Jan 2007 06:44:20 -0000 1.9
+++ result_of.hpp 5 Mar 2007 15:25:15 -0000 1.10
@@ -15,6 +15,8 @@
#include <boost/preprocessor.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/mpl/has_xxx.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/bool.hpp>
#ifndef BOOST_RESULT_OF_NUM_ARGS
# define BOOST_RESULT_OF_NUM_ARGS 10
@@ -55,14 +57,21 @@
typedef typename F::result_type type;
};
+template<typename FArgs>
+struct is_function_with_no_args : mpl::false_ {};
+
+template<typename F>
+struct is_function_with_no_args<F(void)> : mpl::true_ {};
+
template<typename F, typename FArgs>
-struct result_of_impl<F, FArgs, false>
- : F::template result<FArgs>
+struct result_of_nested_result : F::template result<FArgs>
{};
-template<typename F>
-struct result_of_impl<F, F(void), false>
- : result_of_void_impl<F>
+template<typename F, typename FArgs>
+struct result_of_impl<F, FArgs, false>
+ : mpl::if_<is_function_with_no_args<FArgs>,
+ result_of_void_impl<F>,
+ result_of_nested_result<F, FArgs> >::type
{};
} // end namespace detail
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs