sequence_to_array.hpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // (C) Copyright Edward Diener 2011-2015
  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_VMD_DETAIL_SEQUENCE_TO_ARRAY_HPP)
  6. #define BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY_HPP
  7. #include <boost/preprocessor/control/iif.hpp>
  8. #include <boost/vmd/detail/modifiers.hpp>
  9. #include <boost/vmd/detail/mods.hpp>
  10. #include <boost/vmd/detail/not_empty.hpp>
  11. #include <boost/vmd/detail/sequence_elem.hpp>
  12. #define BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY(...) \
  13. BOOST_PP_IIF \
  14. ( \
  15. BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__)), \
  16. BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE \
  17. ( \
  18. BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \
  19. , \
  20. BOOST_VMD_TYPE_ARRAY, \
  21. BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_RETURN,__VA_ARGS__) \
  22. ), \
  23. (0,()) \
  24. ) \
  25. /**/
  26. #define BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY_D(d,...) \
  27. BOOST_PP_IIF \
  28. ( \
  29. BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__)), \
  30. BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE_D \
  31. ( \
  32. d, \
  33. BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \
  34. , \
  35. BOOST_VMD_TYPE_ARRAY, \
  36. BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_RETURN,__VA_ARGS__) \
  37. ), \
  38. (0,()) \
  39. ) \
  40. /**/
  41. #endif /* BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY_HPP */