size.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_SIZE_HPP)
  6. #define BOOST_VMD_SIZE_HPP
  7. #include <boost/vmd/detail/setup.hpp>
  8. #if BOOST_PP_VARIADICS
  9. #include <boost/vmd/detail/sequence_size.hpp>
  10. /*
  11. The succeeding comments in this file are in doxygen format.
  12. */
  13. /** \file
  14. */
  15. /** \def BOOST_VMD_SIZE(sequence)
  16. \brief Returns the size of a sequence.
  17. sequence = A sequence to test.
  18. returns = If the sequence is empty returns 0, else returns the number of elements
  19. in the sequence.
  20. */
  21. #define BOOST_VMD_SIZE(sequence) \
  22. BOOST_VMD_DETAIL_SEQUENCE_SIZE(sequence) \
  23. /**/
  24. /** \def BOOST_VMD_SIZE_D(d,sequence)
  25. \brief Returns the size of a sequence. Re-entrant version.
  26. d = The next available BOOST_PP_WHILE iteration.
  27. sequence = A sequence to test.
  28. returns = If the sequence is empty returns 0, else returns the number of elements
  29. in the sequence.
  30. */
  31. #define BOOST_VMD_SIZE_D(d,sequence) \
  32. BOOST_VMD_DETAIL_SEQUENCE_SIZE_D(d,sequence) \
  33. /**/
  34. #endif /* BOOST_PP_VARIADICS */
  35. #endif /* BOOST_VMD_SIZE_HPP */