define_struct.hpp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*=============================================================================
  2. Copyright (c) 2010-2011 Christopher Schmidt
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #ifndef BOOST_FUSION_ADAPTED_STRUCT_DEFINE_STRUCT_HPP
  7. #define BOOST_FUSION_ADAPTED_STRUCT_DEFINE_STRUCT_HPP
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/adapted/struct/adapt_struct.hpp>
  10. #include <boost/fusion/adapted/struct/detail/define_struct.hpp>
  11. #include <boost/preprocessor/cat.hpp>
  12. #define BOOST_FUSION_DEFINE_TPL_STRUCT( \
  13. TEMPLATE_PARAMS_SEQ, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
  14. \
  15. BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \
  16. TEMPLATE_PARAMS_SEQ, \
  17. (0)NAMESPACE_SEQ, \
  18. NAME, \
  19. BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
  20. 2) \
  21. \
  22. BOOST_FUSION_ADAPT_TPL_STRUCT( \
  23. TEMPLATE_PARAMS_SEQ, \
  24. (BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME)\
  25. TEMPLATE_PARAMS_SEQ, \
  26. ATTRIBUTES)
  27. #define BOOST_FUSION_DEFINE_STRUCT(NAMESPACE_SEQ, NAME, ATTRIBUTES) \
  28. BOOST_FUSION_DEFINE_STRUCT_IMPL( \
  29. (0)NAMESPACE_SEQ, \
  30. NAME, \
  31. BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
  32. 2) \
  33. \
  34. BOOST_FUSION_ADAPT_STRUCT( \
  35. BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME, \
  36. ATTRIBUTES)
  37. #endif