protected.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_HPP_
  2. #define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_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/contract/detail/preprocessor/keyword/utility/is.hpp>
  8. #include <boost/preprocessor/cat.hpp>
  9. /* PRIVATE */
  10. // Must expand to a single comma `,` (not local macros, do not #undefine).
  11. #define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_CAT_TO_COMMAprotected ,
  12. // Must expand to empty `` (not local macros, do not #undefine).
  13. #define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_CAT_TO_EMPTYprotected
  14. /* PUBLIC */
  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_IS_PROTECTED(tokens) \
  18. BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS( \
  19. BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_CAT_TO_COMMA, tokens)
  20. // Precondition: tokens must start with `protected` (this can be
  21. // checked with `..._IS_PROTECTED` macro above).
  22. #define BOOST_CONTRACT_DETAIL_PP_KEYWORD_REMOVE_PROTECTED(tokens) \
  23. BOOST_PP_CAT(BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_CAT_TO_EMPTY, \
  24. tokens)
  25. #endif // #include guard