to_list.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # /* **************************************************************************
  2. # * *
  3. # * (C) Copyright Paul Mensonides 2011. *
  4. # * (C) Copyright Edward Diener 2011. *
  5. # * Distributed under the Boost Software License, Version 1.0. (See *
  6. # * accompanying file LICENSE_1_0.txt or copy at *
  7. # * http://www.boost.org/LICENSE_1_0.txt) *
  8. # * *
  9. # ************************************************************************** */
  10. #
  11. # /* See http://www.boost.org for most recent version. */
  12. #
  13. # ifndef BOOST_PREPROCESSOR_SEQ_TO_LIST_HPP
  14. # define BOOST_PREPROCESSOR_SEQ_TO_LIST_HPP
  15. #
  16. # include <boost/preprocessor/punctuation/comma.hpp>
  17. # include <boost/preprocessor/punctuation/paren.hpp>
  18. # include <boost/preprocessor/seq/detail/binary_transform.hpp>
  19. #
  20. # /* BOOST_PP_SEQ_TO_LIST */
  21. #
  22. # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
  23. # include <boost/preprocessor/seq/size.hpp>
  24. # include <boost/preprocessor/seq/detail/to_list_msvc.hpp>
  25. # define BOOST_PP_SEQ_TO_LIST(seq) \
  26. BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC \
  27. ( \
  28. BOOST_PP_SEQ_TO_LIST_I(BOOST_PP_SEQ_BINARY_TRANSFORM(seq)), \
  29. BOOST_PP_SEQ_SIZE(seq) \
  30. ) \
  31. /**/
  32. # else
  33. # define BOOST_PP_SEQ_TO_LIST(seq) BOOST_PP_SEQ_TO_LIST_I(BOOST_PP_SEQ_BINARY_TRANSFORM(seq))
  34. # endif
  35. # define BOOST_PP_SEQ_TO_LIST_I(bseq) BOOST_PP_SEQ_TO_LIST_A bseq BOOST_PP_NIL BOOST_PP_SEQ_TO_LIST_B bseq
  36. # define BOOST_PP_SEQ_TO_LIST_A(m, e) m(BOOST_PP_LPAREN() e BOOST_PP_COMMA() BOOST_PP_SEQ_TO_LIST_A_ID)
  37. # define BOOST_PP_SEQ_TO_LIST_A_ID() BOOST_PP_SEQ_TO_LIST_A
  38. # define BOOST_PP_SEQ_TO_LIST_B(m, e) m(BOOST_PP_RPAREN() BOOST_PP_SEQ_TO_LIST_B_ID)
  39. # define BOOST_PP_SEQ_TO_LIST_B_ID() BOOST_PP_SEQ_TO_LIST_B
  40. #
  41. # endif