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