is_unary.hpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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_UNARY_HPP)
  6. #define BOOST_VMD_IS_UNARY_HPP
  7. #include <boost/vmd/detail/setup.hpp>
  8. #if BOOST_PP_VARIADICS
  9. #include <boost/vmd/detail/sequence_arity.hpp>
  10. /*
  11. The succeeding comments in this file are in doxygen format.
  12. */
  13. /** \file
  14. */
  15. /** \def BOOST_VMD_IS_UNARY(sequence)
  16. \brief Determines if the sequence has only a single element, referred to as a single-element sequence.
  17. sequence = a VMD sequence
  18. returns = 1 if the sequence is a single-element sequence, else returns 0.
  19. If the size of a sequence is known it is faster comparing that size to be equal
  20. to one to find out if the sequence is single-element. But if the size of the
  21. sequence is not known it is faster calling this macro than getting the size and
  22. doing the previously mentioned comparison in order to determine if the sequence
  23. is single-element or not.
  24. */
  25. #define BOOST_VMD_IS_UNARY(sequence) \
  26. BOOST_VMD_DETAIL_IS_UNARY(sequence) \
  27. /**/
  28. /** \def BOOST_VMD_IS_UNARY_D(d,sequence)
  29. \brief Determines if the sequence has only a single element, referred to as a single-element sequence. Re-entrant version.
  30. d = The next available BOOST_PP_WHILE iteration.
  31. sequence = a sequence
  32. returns = 1 if the sequence is a single-element sequence, else returns 0.
  33. If the size of a sequence is known it is faster comparing that size to be equal
  34. to one to find out if the sequence is single-element. But if the size of the
  35. sequence is not known it is faster calling this macro than getting the size and
  36. doing the previously mentioned comparison in order to determine if the sequence
  37. is single-element or not.
  38. */
  39. #define BOOST_VMD_IS_UNARY_D(d,sequence) \
  40. BOOST_VMD_DETAIL_IS_UNARY_D(d,sequence) \
  41. /**/
  42. #endif /* BOOST_PP_VARIADICS */
  43. #endif /* BOOST_VMD_IS_UNARY_HPP */