mirror of
https://github.com/boostorg/contract.git
synced 2026-02-27 17:02:15 +00:00
tested access on msvc, gcc, clang, and wave
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
|
||||
// WARNING: FILE AUTOMATICALLY GENERATED, DO NOT MODIFY IT!
|
||||
// Instead, modify and run the related generation script "generate.py".
|
||||
|
||||
#ifndef BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_HPP_
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_HPP_
|
||||
|
||||
#include <boost/contract/ext_/preprocessor/keyword/utility/is.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
// PRIVATE //
|
||||
|
||||
// NOTE: These are not local macros, do NOT #undefine them ('x' used to avoid
|
||||
// concatenating to reserved symbols).
|
||||
// The following macro must expand to a unary token (e.g., `(1)`).
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_ISxinvariant (1)
|
||||
#define invariantxBOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_IS (1)
|
||||
// The following macro must expand to nothing.
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVExinvariant
|
||||
#define invariantxBOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVE
|
||||
|
||||
// PUBLIC //
|
||||
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_INVARIANT_FRONT(tokens) \
|
||||
BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \
|
||||
BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_ISx)
|
||||
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_INVARIANT_BACK(token) \
|
||||
BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \
|
||||
xBOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_IS)
|
||||
|
||||
// Precondition: tokens start with keyword to remove (see `..._IS_INVARIANT_FRONT`).
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVE_FRONT(tokens) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVEx, tokens)
|
||||
|
||||
// Precondition: token ends with keyword to remove (see `..._IS_INVARIANT_BACK`).
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVE_BACK(token) \
|
||||
BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVE)
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
|
||||
// Copyright (C) 2008-2012 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// (see accompanying file LICENSE_1_0.txt or a copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
// Home at http://sourceforge.net/projects/contractpp
|
||||
|
||||
#ifndef BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_HPP_
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_HPP_
|
||||
|
||||
@@ -20,9 +14,9 @@
|
||||
|
||||
// PUBLIC //
|
||||
|
||||
// `checking_prefix ## tokens` expand to unary (e.g., `(1)`) iff `tokens` start
|
||||
// with keyword to check.
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS( \
|
||||
// Precondition: A macro `<checking_prefix><keyword-to-check>` must be #defined
|
||||
// to expand to unary (e.g., `(1)`).
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \
|
||||
tokens, checking_prefix) \
|
||||
BOOST_PP_IIF(BOOST_CONTRACT_EXT_PP_HAS_PAREN(tokens), \
|
||||
0 BOOST_PP_TUPLE_EAT(2) \
|
||||
@@ -30,5 +24,15 @@
|
||||
BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_ \
|
||||
)(checking_prefix, tokens)
|
||||
|
||||
// Precondition: A macro `<keyword-to-check><checking_postfix>` must be #defined
|
||||
// to expand to unary (e.g., `(1)`).
|
||||
// WARNING: This check only works if `token` is a single token, it will always
|
||||
// expand to 0 with no errors if token is multiple tokens
|
||||
// (e.g., `const *this`). Also, this check will expand to 0 with no error if
|
||||
// `token` starts with a non-alphanumeric symbol (e.g., `*this`).
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \
|
||||
token, checking_postfix) \
|
||||
BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_(token, checking_postfix)
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
|
||||
// Copyright (C) 2008-2012 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// (see accompanying file LICENSE_1_0.txt or a copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
// Home at http://sourceforge.net/projects/contractpp
|
||||
|
||||
#ifndef BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REM_HPP_
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REM_HPP_
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
// PRIVATE //
|
||||
|
||||
// Adapted from BOOST_PP_EXPAND.
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REMOVE_EXPAND_I_(tokens) \
|
||||
tokens
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REM_EXPAND_(tokens) \
|
||||
BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REMOVE_EXPAND_I_(tokens)
|
||||
|
||||
// PUBLIC //
|
||||
|
||||
// `removing_prefix ## <keyword-to-remove>` must expand to nothing, else 0.
|
||||
// Precondition: Tokens start with keyword to remove (see KEYWORD_UTILITY_IS).
|
||||
// IMPLEMENTATION: Below without EXPAND doesn't expand on MSVC.
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REM(tokens, removing_prefix) \
|
||||
BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REM_EXPAND_( \
|
||||
BOOST_PP_CAT(removing_prefix, tokens))
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
Reference in New Issue
Block a user