is.hpp 1.1 KB

123456789101112131415161718192021222324252627282930
  1. #ifndef BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS_HPP_
  2. #define BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS_HPP_
  3. // Copyright (C) 2008-2018 Lorenzo Caminiti
  4. // Distributed under the Boost Software License, Version 1.0 (see accompanying
  5. // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
  6. // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
  7. #include <boost/preprocessor/cat.hpp>
  8. #include <boost/preprocessor/variadic/size.hpp>
  9. /* PRIVATE */
  10. #define BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS_1 0
  11. #define BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS_2 1
  12. /* PUBLIC */
  13. // Precondition: A macro named `cat_to_comma_prefix ## token-to-check` must be
  14. // #defined to expand to `,`.
  15. // Precondition: tokens must start with a token concatenable to a macro name
  16. // (e.g., a literal or integral token).
  17. #define BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS( \
  18. cat_to_comma_prefix, tokens) \
  19. BOOST_PP_CAT(BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS_, \
  20. BOOST_PP_VARIADIC_SIZE(BOOST_PP_CAT(cat_to_comma_prefix, tokens)))
  21. #endif // #include guard