parameter_types.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // (C) Copyright Tobias Schwinger
  2. //
  3. // Use modification and distribution are subject to the boost Software License,
  4. // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
  5. //------------------------------------------------------------------------------
  6. #ifndef BOOST_FT_PARAMETER_TYPES_HPP_INCLUDED
  7. #define BOOST_FT_PARAMETER_TYPES_HPP_INCLUDED
  8. #include <boost/blank.hpp>
  9. #include <boost/mpl/if.hpp>
  10. #include <boost/mpl/aux_/lambda_support.hpp>
  11. #include <boost/mpl/pop_front.hpp>
  12. #include <boost/function_types/is_callable_builtin.hpp>
  13. #include <boost/function_types/components.hpp>
  14. namespace boost
  15. {
  16. namespace function_types
  17. {
  18. using mpl::placeholders::_;
  19. template< typename T, typename ClassTypeTransform = add_reference<_> >
  20. struct parameter_types;
  21. namespace detail
  22. {
  23. template<typename T, typename ClassTypeTransform>
  24. struct parameter_types_impl
  25. : mpl::pop_front
  26. < typename function_types::components<T,ClassTypeTransform>::types
  27. >::type
  28. { };
  29. }
  30. template<typename T, typename ClassTypeTransform> struct parameter_types
  31. : mpl::if_
  32. < function_types::is_callable_builtin<T>
  33. , detail::parameter_types_impl<T,ClassTypeTransform>, boost::blank
  34. >::type
  35. {
  36. BOOST_MPL_AUX_LAMBDA_SUPPORT(2,parameter_types,(T,ClassTypeTransform))
  37. };
  38. }
  39. }
  40. #endif