sequence_enum.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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_ENUM_HPP)
  6. #define BOOST_VMD_DETAIL_SEQUENCE_ENUM_HPP
  7. #include <boost/preprocessor/control/iif.hpp>
  8. #include <boost/preprocessor/tuple/enum.hpp>
  9. #include <boost/vmd/empty.hpp>
  10. #include <boost/vmd/is_empty.hpp>
  11. #include <boost/vmd/detail/sequence_to_tuple.hpp>
  12. #define BOOST_VMD_DETAIL_SEQUENCE_ENUM_PROCESS(tuple) \
  13. BOOST_PP_IIF \
  14. ( \
  15. BOOST_VMD_IS_EMPTY(tuple), \
  16. BOOST_VMD_EMPTY, \
  17. BOOST_PP_TUPLE_ENUM \
  18. ) \
  19. (tuple) \
  20. /**/
  21. #define BOOST_VMD_DETAIL_SEQUENCE_ENUM(...) \
  22. BOOST_VMD_DETAIL_SEQUENCE_ENUM_PROCESS \
  23. ( \
  24. BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE(__VA_ARGS__) \
  25. ) \
  26. /**/
  27. #define BOOST_VMD_DETAIL_SEQUENCE_ENUM_D(d,...) \
  28. BOOST_VMD_DETAIL_SEQUENCE_ENUM_PROCESS \
  29. ( \
  30. BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE_D(d,__VA_ARGS__) \
  31. ) \
  32. /**/
  33. #endif /* BOOST_VMD_DETAIL_SEQUENCE_ENUM_HPP */