result_of.hpp

Go to the documentation of this file.
00001 // Boost result_of library
00002 
00003 //  Copyright Douglas Gregor 2004. Use, modification and
00004 //  distribution is subject to the Boost Software License, Version
00005 //  1.0. (See accompanying file LICENSE_1_0.txt or copy at
00006 //  http://www.boost.org/LICENSE_1_0.txt)
00007 
00008 // For more information, see http://www.boost.org/libs/utility
00009 #ifndef BOOST_RESULT_OF_HPP
00010 #define BOOST_RESULT_OF_HPP
00011 
00012 #include <sysc/packages/boost/config.hpp>
00013 #include <sysc/packages/boost/type_traits/ice.hpp>
00014 #include <sysc/packages/boost/type.hpp>
00015 #include <sysc/packages/boost/preprocessor.hpp>
00016 #include <sysc/packages/boost/detail/workaround.hpp>
00017 #include <sysc/packages/boost/mpl/has_xxx.hpp>
00018 
00019 #ifndef BOOST_RESULT_OF_NUM_ARGS
00020 #  define BOOST_RESULT_OF_NUM_ARGS 10
00021 #endif
00022 
00023 namespace boost {
00024 
00025 template<typename F> struct result_of;
00026 
00027 #if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
00028 namespace detail {
00029 
00030 BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
00031 
00032 template<typename F, typename FArgs, bool HasResultType> struct get_result_of;
00033 
00034 template<typename F, typename FArgs>
00035 struct get_result_of<F, FArgs, true>
00036 {
00037   typedef typename F::result_type type;
00038 };
00039 
00040 template<typename F, typename FArgs>
00041 struct get_result_of<F, FArgs, false>
00042 {
00043   typedef typename F::template result<FArgs>::type type;
00044 };
00045 
00046 template<typename F>
00047 struct get_result_of<F, F(void), false>
00048 {
00049   typedef void type;
00050 };
00051 
00052 template<typename F, typename FArgs>
00053 struct result_of : get_result_of<F, FArgs, (has_result_type<F>::value)> {};
00054 
00055 } // end namespace detail
00056 
00057 #define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_RESULT_OF_NUM_ARGS,<sysc/packages/boost/utility/detail/result_of_iterate.hpp>))
00058 #include BOOST_PP_ITERATE()
00059 
00060 #else
00061 #  define BOOST_NO_RESULT_OF 1
00062 #endif
00063 
00064 }
00065 
00066 #endif // BOOST_RESULT_OF_HPP

Generated on Wed Jan 21 15:32:10 2009 for SystemC by  doxygen 1.5.5