ddata.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // (C) Copyright Edward Diener 2012
  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_DATA_HPP)
  6. #define BOOST_TTI_DETAIL_DATA_HPP
  7. #include <boost/config.hpp>
  8. #include <boost/preprocessor/cat.hpp>
  9. #include <boost/tti/detail/dmem_data.hpp>
  10. #include <boost/tti/detail/dstatic_mem_data.hpp>
  11. #include <boost/tti/gen/namespace_gen.hpp>
  12. #include <boost/type_traits/remove_const.hpp>
  13. #define BOOST_TTI_DETAIL_TRAIT_HAS_DATA(trait,name) \
  14. BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_DATA(trait,name) \
  15. BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
  16. template<class BOOST_TTI_DETAIL_TP_ET,class BOOST_TTI_DETAIL_TP_DT> \
  17. struct BOOST_PP_CAT(trait,_detail_hd) \
  18. { \
  19. \
  20. typedef typename \
  21. BOOST_PP_CAT(trait,_detail_hmd) \
  22. < \
  23. typename BOOST_TTI_NAMESPACE::detail::ptmd<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_DT>::type, \
  24. typename boost::remove_const<BOOST_TTI_DETAIL_TP_ET>::type \
  25. >::type hmdtype; \
  26. \
  27. typedef typename \
  28. BOOST_PP_CAT(trait,_detail_hsd)<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_DT>::type hsdtype; \
  29. \
  30. BOOST_STATIC_CONSTANT \
  31. ( \
  32. bool, \
  33. value = hmdtype::value || hsdtype::value \
  34. ); \
  35. \
  36. typedef boost::mpl::bool_<value> type; \
  37. }; \
  38. /**/
  39. #endif // BOOST_TTI_DETAIL_DATA_HPP