dcomp_mem_fun_template.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // (C) Copyright Edward Diener 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_COMP_MEM_FUN_TEMPLATE_HPP)
  6. #define BOOST_TTI_DETAIL_COMP_MEM_FUN_TEMPLATE_HPP
  7. #include <boost/mpl/bool.hpp>
  8. #include <boost/preprocessor/cat.hpp>
  9. #include <boost/preprocessor/array/enum.hpp>
  10. #include <boost/tti/detail/dftclass.hpp>
  11. #include <boost/tti/detail/dnullptr.hpp>
  12. #include <boost/tti/detail/dmacro_sunfix.hpp>
  13. #include <boost/tti/gen/namespace_gen.hpp>
  14. #include <boost/type_traits/remove_const.hpp>
  15. #include <boost/type_traits/detail/yes_no_type.hpp>
  16. #define BOOST_TTI_DETAIL_TRAIT_HAS_COMP_MEMBER_FUNCTION_TEMPLATE(trait,name,tparray) \
  17. template<class BOOST_TTI_DETAIL_TP_T> \
  18. struct BOOST_PP_CAT(trait,_detail_hcmft) \
  19. { \
  20. template<class BOOST_TTI_DETAIL_TP_F> \
  21. struct cl_type : \
  22. boost::remove_const \
  23. < \
  24. typename BOOST_TTI_NAMESPACE::detail::class_type<BOOST_TTI_DETAIL_TP_F>::type \
  25. > \
  26. { \
  27. }; \
  28. \
  29. template<BOOST_TTI_DETAIL_TP_T> \
  30. struct helper BOOST_TTI_DETAIL_MACRO_SUNFIX ; \
  31. \
  32. template<class BOOST_TTI_DETAIL_TP_U> \
  33. static ::boost::type_traits::yes_type check(helper<&BOOST_TTI_DETAIL_TP_U::template name<BOOST_PP_ARRAY_ENUM(tparray)> > *); \
  34. \
  35. template<class BOOST_TTI_DETAIL_TP_U> \
  36. static ::boost::type_traits::no_type check(...); \
  37. \
  38. typedef boost::mpl::bool_<sizeof(check<typename cl_type<BOOST_TTI_DETAIL_TP_T>::type>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \
  39. }; \
  40. /**/
  41. #endif // BOOST_TTI_DETAIL_COMP_MEM_FUN_TEMPLATE_HPP