is_list.hpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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_IS_LIST_HPP)
  6. #define BOOST_VMD_IS_LIST_HPP
  7. #include <boost/vmd/detail/setup.hpp>
  8. #if BOOST_PP_VARIADICS
  9. #include <boost/vmd/detail/is_list.hpp>
  10. /*
  11. The succeeding comments in this file are in doxygen format.
  12. */
  13. /** \file
  14. */
  15. /** \def BOOST_VMD_IS_LIST(sequence)
  16. \brief Determines if a sequence is a Boost pplib list.
  17. The macro checks that the sequence is a pplib list.
  18. It returns 1 if it is a list, else if returns 0.
  19. sequence = input as a possible Boost PP list.
  20. returns = 1 if it a list, else returns 0.
  21. The macro will generate a preprocessing error if the input
  22. is in the form of a list but its end-of-list marker, instead
  23. of being an identifier, is a preprocessor token which VMD cannot parse,
  24. as in the example '(anything,&BOOST_PP_NIL)' which is a valid tuple but
  25. an invalid list.
  26. */
  27. #define BOOST_VMD_IS_LIST(sequence) \
  28. BOOST_VMD_DETAIL_IS_LIST(sequence) \
  29. /**/
  30. /** \def BOOST_VMD_IS_LIST_D(d,sequence)
  31. \brief Determines if a sequence is a Boost pplib list. Re-entrant version.
  32. The macro checks that the sequence is a pplib list.
  33. It returns 1 if it is a list, else if returns 0.
  34. d = The next available BOOST_PP_WHILE iteration.
  35. sequence = input as a possible Boost PP list.
  36. returns = 1 if it a list, else returns 0.
  37. The macro will generate a preprocessing error if the input
  38. is in the form of a list but its end-of-list marker, instead
  39. of being an identifier, is a preprocessor token which VMD cannot parse,
  40. as in the example '(anything,&BOOST_PP_NIL)' which is a valid tuple but
  41. an invalid list.
  42. */
  43. #define BOOST_VMD_IS_LIST_D(d,sequence) \
  44. BOOST_VMD_DETAIL_IS_LIST_D(d,sequence) \
  45. /**/
  46. #endif /* BOOST_PP_VARIADICS */
  47. #endif /* BOOST_VMD_IS_LIST_HPP */