function_arity.hpp 888 B

123456789101112131415161718192021222324252627282930313233343536
  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_FUNCTION_ARITY_HPP_INCLUDED
  7. #define BOOST_FT_FUNCTION_ARITY_HPP_INCLUDED
  8. #include <boost/blank.hpp>
  9. #include <boost/mpl/if.hpp>
  10. #include <boost/mpl/aux_/lambda_support.hpp>
  11. #include <boost/function_types/is_callable_builtin.hpp>
  12. #include <boost/function_types/components.hpp>
  13. namespace boost
  14. {
  15. namespace function_types
  16. {
  17. template<typename T> struct function_arity
  18. : mpl::if_
  19. < function_types::is_callable_builtin<T>
  20. , typename components<T>::function_arity, boost::blank
  21. >::type
  22. {
  23. BOOST_MPL_AUX_LAMBDA_SUPPORT(1,function_arity,(T))
  24. };
  25. }
  26. }
  27. #endif