virtual.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef BOOST_CONTRACT_DETAIL_PP_KEYWORD_VIRTUAL_HPP_
  2. #define BOOST_CONTRACT_DETAIL_PP_KEYWORD_VIRTUAL_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_VIRTUAL_CAT_TO_COMMAvirtual ,
  12. // Must expand to empty `` (not local macros, do not #undefine).
  13. #define BOOST_CONTRACT_DETAIL_PP_KEYWORD_VIRTUAL_CAT_TO_EMPTYvirtual
  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_VIRTUAL(tokens) \
  18. BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS( \
  19. BOOST_CONTRACT_DETAIL_PP_KEYWORD_VIRTUAL_CAT_TO_COMMA, tokens)
  20. // Precondition: tokens must start with `virtual` (this can be
  21. // checked with `..._IS_VIRTUAL` macro above).
  22. #define BOOST_CONTRACT_DETAIL_PP_KEYWORD_REMOVE_VIRTUAL(tokens) \
  23. BOOST_PP_CAT(BOOST_CONTRACT_DETAIL_PP_KEYWORD_VIRTUAL_CAT_TO_EMPTY, tokens)
  24. #endif // #include guard