Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1 | |
| 2 | // (C) Copyright Tobias Schwinger |
| 3 | // |
| 4 | // Use modification and distribution are subject to the boost Software License, |
| 5 | // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). |
| 6 | |
| 7 | //------------------------------------------------------------------------------ |
| 8 | |
| 9 | #ifndef BOOST_FT_PARAMETER_TYPES_HPP_INCLUDED |
| 10 | #define BOOST_FT_PARAMETER_TYPES_HPP_INCLUDED |
| 11 | |
| 12 | #include <ndnboost/blank.hpp> |
| 13 | #include <ndnboost/mpl/if.hpp> |
| 14 | |
| 15 | #include <ndnboost/mpl/aux_/lambda_support.hpp> |
| 16 | #include <ndnboost/type_traits/detail/template_arity_spec.hpp> |
| 17 | |
| 18 | #include <ndnboost/mpl/pop_front.hpp> |
| 19 | |
| 20 | #include <ndnboost/function_types/is_callable_builtin.hpp> |
| 21 | #include <ndnboost/function_types/components.hpp> |
| 22 | |
| 23 | namespace ndnboost |
| 24 | { |
| 25 | namespace function_types |
| 26 | { |
| 27 | using mpl::placeholders::_; |
| 28 | |
| 29 | template< typename T, typename ClassTypeTransform = add_reference<_> > |
| 30 | struct parameter_types; |
| 31 | |
| 32 | namespace detail |
| 33 | { |
| 34 | template<typename T, typename ClassTypeTransform> |
| 35 | struct parameter_types_impl |
| 36 | : mpl::pop_front |
| 37 | < typename function_types::components<T,ClassTypeTransform>::types |
| 38 | >::type |
| 39 | { }; |
| 40 | } |
| 41 | |
| 42 | template<typename T, typename ClassTypeTransform> struct parameter_types |
| 43 | : mpl::if_ |
| 44 | < function_types::is_callable_builtin<T> |
| 45 | , detail::parameter_types_impl<T,ClassTypeTransform>, ndnboost::blank |
| 46 | >::type |
| 47 | { |
| 48 | BOOST_MPL_AUX_LAMBDA_SUPPORT(2,parameter_types,(T,ClassTypeTransform)) |
| 49 | }; |
| 50 | } |
| 51 | BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::parameter_types) |
| 52 | } |
| 53 | |
| 54 | #endif |
| 55 | |