is_type.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_TYPE_HPP)
  6. #define BOOST_VMD_IS_TYPE_HPP
  7. #include <boost/vmd/detail/setup.hpp>
  8. #if BOOST_PP_VARIADICS
  9. #include <boost/vmd/detail/is_type.hpp>
  10. /*
  11. The succeeding comments in this file are in doxygen format.
  12. */
  13. /** \file
  14. */
  15. /** \def BOOST_VMD_IS_TYPE(sequence)
  16. \brief Tests whether a sequence is a VMD type.
  17. sequence = a possible VMD type
  18. returns = 1 if the sequence is a VMD type,
  19. 0 if it is not.
  20. If the sequence is not a VMD data type this macro could lead to
  21. a preprocessor error. This is because the macro
  22. uses preprocessor concatenation to determine if the sequence
  23. is an identifier once it is determined that the sequence does not
  24. start with parentheses. If the data being concatenated would
  25. lead to an invalid preprocessor token the compiler can issue
  26. a preprocessor error.
  27. */
  28. #define BOOST_VMD_IS_TYPE(sequence) \
  29. BOOST_VMD_DETAIL_IS_TYPE(sequence) \
  30. /**/
  31. /** \def BOOST_VMD_IS_TYPE_D(d,sequence)
  32. \brief Tests whether a sequence is a VMD type. Re-entrant version.
  33. d = The next available BOOST_PP_WHILE iteration.
  34. sequence = a possible VMD type
  35. returns = 1 if the sequence is a VMD type,
  36. 0 if it is not.
  37. If the sequence is not a VMD data type this macro could lead to
  38. a preprocessor error. This is because the macro
  39. uses preprocessor concatenation to determine if the sequence
  40. is an identifier once it is determined that the sequence does not
  41. start with parentheses. If the data being concatenated would
  42. lead to an invalid preprocessor token the compiler can issue
  43. a preprocessor error.
  44. */
  45. #define BOOST_VMD_IS_TYPE_D(d,sequence) \
  46. BOOST_VMD_DETAIL_IS_TYPE_D(d,sequence) \
  47. /**/
  48. #endif /* BOOST_PP_VARIADICS */
  49. #endif /* BOOST_VMD_IS_TYPE_HPP */