dfunction.hpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // (C) Copyright Edward Diener 2012,2013,2019
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. #if !defined(BOOST_TTI_DETAIL_FUNCTION_HPP)
  6. #define BOOST_TTI_DETAIL_FUNCTION_HPP
  7. #include <boost/mpl/and.hpp>
  8. #include <boost/mpl/eval_if.hpp>
  9. #include <boost/mpl/or.hpp>
  10. #include <boost/preprocessor/cat.hpp>
  11. #include <boost/tti/detail/dmem_fun.hpp>
  12. #include <boost/tti/detail/dstatic_mem_fun.hpp>
  13. #include <boost/tti/detail/dtfunction.hpp>
  14. #include <boost/tti/detail/denclosing_type.hpp>
  15. #include <boost/tti/detail/dstatic_function_tags.hpp>
  16. #include <boost/tti/gen/namespace_gen.hpp>
  17. #define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC_CALL(trait,name) \
  18. BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
  19. template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
  20. struct BOOST_PP_CAT(trait,_detail_hfsc) : \
  21. BOOST_PP_CAT(trait,_detail_ihsmf) \
  22. < \
  23. BOOST_TTI_DETAIL_TP_T, \
  24. typename BOOST_TTI_NAMESPACE::detail::tfunction_seq<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>::type \
  25. > \
  26. { \
  27. }; \
  28. /**/
  29. #define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC(trait,name) \
  30. BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC_CALL(trait,name) \
  31. template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
  32. struct BOOST_PP_CAT(trait,_detail_hfs) : \
  33. boost::mpl::eval_if \
  34. < \
  35. boost::mpl::and_ \
  36. < \
  37. BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
  38. BOOST_TTI_NAMESPACE::detail::static_function_tag<BOOST_TTI_DETAIL_TP_TAG> \
  39. >, \
  40. BOOST_PP_CAT(trait,_detail_hfsc)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
  41. boost::mpl::false_ \
  42. > \
  43. { \
  44. }; \
  45. /**/
  46. #define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION(trait,name) \
  47. BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \
  48. BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC(trait,name) \
  49. template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
  50. struct BOOST_PP_CAT(trait,_detail_hf) : \
  51. boost::mpl::or_ \
  52. < \
  53. BOOST_PP_CAT(trait,_detail_hmf_call_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
  54. BOOST_PP_CAT(trait,_detail_hfs)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
  55. > \
  56. { \
  57. }; \
  58. /**/
  59. #endif // BOOST_TTI_DETAIL_FUNCTION_HPP