is_vmd_tuple.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_IS_VMD_TUPLE_HPP)
  6. #define BOOST_VMD_IS_VMD_TUPLE_HPP
  7. #include <boost/vmd/detail/setup.hpp>
  8. #if BOOST_PP_VARIADICS
  9. #include <boost/preprocessor/control/iif.hpp>
  10. #include <boost/vmd/identity.hpp>
  11. #include <boost/vmd/is_empty.hpp>
  12. #include <boost/vmd/is_tuple.hpp>
  13. /*
  14. The succeeding comments in this file are in doxygen format.
  15. */
  16. /** \file
  17. */
  18. /** \def BOOST_VMD_IS_VMD_TUPLE(sequence)
  19. \brief Determines if a sequence is a VMD tuple.
  20. The macro checks that the sequence is a VMD tuple.
  21. A VMD tuple, which may be a Boost PP tuple or emptiness, is a superset of a Boost PP tuple.
  22. It returns 1 if it is a VMD tuple, else if returns 0.
  23. sequence = a possible Boost PP tuple
  24. returns = 1 if it a VMD tuple, else returns 0.
  25. */
  26. #define BOOST_VMD_IS_VMD_TUPLE(sequence) \
  27. BOOST_VMD_IDENTITY_RESULT \
  28. ( \
  29. BOOST_PP_IIF \
  30. ( \
  31. BOOST_VMD_IS_EMPTY(sequence), \
  32. BOOST_VMD_IDENTITY(1), \
  33. BOOST_VMD_IS_TUPLE \
  34. ) \
  35. (sequence) \
  36. ) \
  37. /**/
  38. #endif /* BOOST_PP_VARIADICS */
  39. #endif /* BOOST_VMD_IS_VMD_TUPLE_HPP */