to_seq.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // (C) Copyright Edward Diener 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_ARRAY_TO_SEQ_HPP)
  6. #define BOOST_VMD_ARRAY_TO_SEQ_HPP
  7. #include <boost/vmd/detail/setup.hpp>
  8. #if BOOST_PP_VARIADICS
  9. #include <boost/preprocessor/control/iif.hpp>
  10. #include <boost/preprocessor/array/to_seq.hpp>
  11. #include <boost/vmd/empty.hpp>
  12. #include <boost/vmd/is_empty_array.hpp>
  13. /*
  14. The succeeding comments in this file are in doxygen format.
  15. */
  16. /** \file
  17. */
  18. /** \def BOOST_VMD_ARRAY_TO_SEQ(array)
  19. \brief converts an array to a seq.
  20. array = array to be converted.
  21. If the array is an array of 0 elements it is converted to an empty seq.
  22. Otherwise the array is converted to a seq with the same number of elements as the array.
  23. */
  24. #define BOOST_VMD_ARRAY_TO_SEQ(array) \
  25. BOOST_PP_IIF \
  26. ( \
  27. BOOST_VMD_IS_EMPTY_ARRAY(array), \
  28. BOOST_VMD_EMPTY, \
  29. BOOST_PP_ARRAY_TO_SEQ \
  30. ) \
  31. (array) \
  32. /**/
  33. #endif /* BOOST_PP_VARIADICS */
  34. #endif /* BOOST_VMD_ARRAY_TO_SEQ_HPP */