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