From ff6eeaab3bbf5a0552da3337661468d81abcdabe Mon Sep 17 00:00:00 2001 From: Lorenzo Caminiti Date: Tue, 16 Dec 2014 11:43:48 -0800 Subject: [PATCH] parsing template parameters --- .../ext_/preprocessor/keyword/alignas.hpp | 44 +++--- .../ext_/preprocessor/keyword/alignof.hpp | 44 +++--- .../ext_/preprocessor/keyword/and.hpp | 44 +++--- .../ext_/preprocessor/keyword/and_eq.hpp | 44 +++--- .../ext_/preprocessor/keyword/asm.hpp | 44 +++--- .../ext_/preprocessor/keyword/auto.hpp | 44 +++--- .../ext_/preprocessor/keyword/bitand.hpp | 44 +++--- .../ext_/preprocessor/keyword/bitor.hpp | 44 +++--- .../ext_/preprocessor/keyword/bool.hpp | 44 +++--- .../ext_/preprocessor/keyword/break.hpp | 44 +++--- .../ext_/preprocessor/keyword/case.hpp | 44 +++--- .../ext_/preprocessor/keyword/catch.hpp | 44 +++--- .../ext_/preprocessor/keyword/char.hpp | 44 +++--- .../ext_/preprocessor/keyword/char16_t.hpp | 44 +++--- .../ext_/preprocessor/keyword/char32_t.hpp | 44 +++--- .../ext_/preprocessor/keyword/class.hpp | 44 +++--- .../ext_/preprocessor/keyword/compl.hpp | 44 +++--- .../ext_/preprocessor/keyword/const.hpp | 44 +++--- .../ext_/preprocessor/keyword/const_cast.hpp | 44 +++--- .../ext_/preprocessor/keyword/constexpr.hpp | 44 +++--- .../ext_/preprocessor/keyword/continue.hpp | 44 +++--- .../preprocessor/keyword/contract/extends.hpp | 44 +++--- .../keyword/contract/invariant.hpp | 44 +++--- .../keyword/contract/postcondition.hpp | 44 +++--- .../keyword/contract/precondition.hpp | 44 +++--- .../keyword/contract/verbatim.hpp | 44 +++--- .../ext_/preprocessor/keyword/decltype.hpp | 44 +++--- .../ext_/preprocessor/keyword/default.hpp | 44 +++--- .../ext_/preprocessor/keyword/delete.hpp | 44 +++--- .../contract/ext_/preprocessor/keyword/do.hpp | 44 +++--- .../ext_/preprocessor/keyword/double.hpp | 44 +++--- .../preprocessor/keyword/dynamic_cast.hpp | 44 +++--- .../ext_/preprocessor/keyword/else.hpp | 44 +++--- .../ext_/preprocessor/keyword/enum.hpp | 44 +++--- .../ext_/preprocessor/keyword/explicit.hpp | 44 +++--- .../ext_/preprocessor/keyword/export.hpp | 44 +++--- .../ext_/preprocessor/keyword/extern.hpp | 44 +++--- .../ext_/preprocessor/keyword/false.hpp | 44 +++--- .../ext_/preprocessor/keyword/final.hpp | 44 +++--- .../ext_/preprocessor/keyword/float.hpp | 44 +++--- .../ext_/preprocessor/keyword/for.hpp | 44 +++--- .../ext_/preprocessor/keyword/friend.hpp | 44 +++--- .../ext_/preprocessor/keyword/generate.py | 137 +++++++++++++++--- .../ext_/preprocessor/keyword/goto.hpp | 44 +++--- .../contract/ext_/preprocessor/keyword/if.hpp | 44 +++--- .../ext_/preprocessor/keyword/inline.hpp | 44 +++--- .../ext_/preprocessor/keyword/int.hpp | 44 +++--- .../ext_/preprocessor/keyword/long.hpp | 44 +++--- .../ext_/preprocessor/keyword/mutable.hpp | 44 +++--- .../ext_/preprocessor/keyword/namespace.hpp | 44 +++--- .../ext_/preprocessor/keyword/new.hpp | 44 +++--- .../ext_/preprocessor/keyword/noexcept.hpp | 44 +++--- .../ext_/preprocessor/keyword/not.hpp | 44 +++--- .../ext_/preprocessor/keyword/not_eq.hpp | 44 +++--- .../ext_/preprocessor/keyword/nullptr.hpp | 44 +++--- .../ext_/preprocessor/keyword/operator.hpp | 44 +++--- .../contract/ext_/preprocessor/keyword/or.hpp | 44 +++--- .../ext_/preprocessor/keyword/or_eq.hpp | 44 +++--- .../ext_/preprocessor/keyword/override.hpp | 44 +++--- .../ext_/preprocessor/keyword/private.hpp | 44 +++--- .../ext_/preprocessor/keyword/protected.hpp | 44 +++--- .../ext_/preprocessor/keyword/public.hpp | 44 +++--- .../ext_/preprocessor/keyword/register.hpp | 44 +++--- .../preprocessor/keyword/reinterpret_cast.hpp | 44 +++--- .../ext_/preprocessor/keyword/return.hpp | 44 +++--- .../ext_/preprocessor/keyword/short.hpp | 44 +++--- .../ext_/preprocessor/keyword/signed.hpp | 44 +++--- .../ext_/preprocessor/keyword/sizeof.hpp | 44 +++--- .../ext_/preprocessor/keyword/static.hpp | 44 +++--- .../preprocessor/keyword/static_assert.hpp | 44 +++--- .../ext_/preprocessor/keyword/static_cast.hpp | 44 +++--- .../ext_/preprocessor/keyword/struct.hpp | 44 +++--- .../ext_/preprocessor/keyword/switch.hpp | 44 +++--- .../ext_/preprocessor/keyword/template.hpp | 44 +++--- .../ext_/preprocessor/keyword/this.hpp | 44 +++--- .../preprocessor/keyword/thread_local.hpp | 44 +++--- .../ext_/preprocessor/keyword/throw.hpp | 44 +++--- .../ext_/preprocessor/keyword/true.hpp | 44 +++--- .../ext_/preprocessor/keyword/try.hpp | 44 +++--- .../ext_/preprocessor/keyword/typedef.hpp | 44 +++--- .../ext_/preprocessor/keyword/typeid.hpp | 44 +++--- .../ext_/preprocessor/keyword/typename.hpp | 44 +++--- .../ext_/preprocessor/keyword/union.hpp | 44 +++--- .../ext_/preprocessor/keyword/unsigned.hpp | 44 +++--- .../ext_/preprocessor/keyword/using.hpp | 44 +++--- .../ext_/preprocessor/keyword/utility/is.hpp | 43 +++--- .../ext_/preprocessor/keyword/virtual.hpp | 44 +++--- .../ext_/preprocessor/keyword/void.hpp | 44 +++--- .../ext_/preprocessor/keyword/volatile.hpp | 44 +++--- .../ext_/preprocessor/keyword/wchar_t.hpp | 44 +++--- .../ext_/preprocessor/keyword/while.hpp | 44 +++--- .../ext_/preprocessor/keyword/xor.hpp | 44 +++--- .../ext_/preprocessor/keyword/xor_eq.hpp | 44 +++--- 93 files changed, 2325 insertions(+), 1859 deletions(-) diff --git a/include/boost/contract/ext_/preprocessor/keyword/alignas.hpp b/include/boost/contract/ext_/preprocessor/keyword/alignas.hpp index 92acdc0..71e8427 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/alignas.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/alignas.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_ALIGNAS_ISxalignas (1) -#define alignasxBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_REMOVExalignas -#define alignasxBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_CAT_TO_COMMAalignas , +#define alignasBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_CAT_TO_EMPTYalignas +#define alignasBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ALIGNAS_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ALIGNAS_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ALIGNAS_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_ALIGNAS_FRONT`). +// Precondition: tokens must start with `alignas` (this can be +// checked with `..._IS_ALIGNAS_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_ALIGNAS_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_REMOVE) +// Precondition: tokens must end with `alignas` (this can be +// checked with `..._IS_ALIGNAS_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNAS_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/alignof.hpp b/include/boost/contract/ext_/preprocessor/keyword/alignof.hpp index 438d5dc..a6a92e8 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/alignof.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/alignof.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_ALIGNOF_ISxalignof (1) -#define alignofxBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_REMOVExalignof -#define alignofxBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_CAT_TO_COMMAalignof , +#define alignofBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_CAT_TO_EMPTYalignof +#define alignofBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ALIGNOF_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ALIGNOF_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ALIGNOF_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_ALIGNOF_FRONT`). +// Precondition: tokens must start with `alignof` (this can be +// checked with `..._IS_ALIGNOF_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_ALIGNOF_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_REMOVE) +// Precondition: tokens must end with `alignof` (this can be +// checked with `..._IS_ALIGNOF_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_ALIGNOF_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/and.hpp b/include/boost/contract/ext_/preprocessor/keyword/and.hpp index ac4eca4..330baa3 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/and.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/and.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_AND_ISxand (1) -#define andxBOOST_CONTRACT_EXT_PP_KEYWORD_AND_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_REMOVExand -#define andxBOOST_CONTRACT_EXT_PP_KEYWORD_AND_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_CAT_TO_COMMAand , +#define andBOOST_CONTRACT_EXT_PP_KEYWORD_AND_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_CAT_TO_EMPTYand +#define andBOOST_CONTRACT_EXT_PP_KEYWORD_AND_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_AND_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_AND_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_AND_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_AND_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_AND_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_AND_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_AND_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_AND_FRONT`). +// Precondition: tokens must start with `and` (this can be +// checked with `..._IS_AND_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_AND_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_AND_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_AND_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_AND_REMOVE) +// Precondition: tokens must end with `and` (this can be +// checked with `..._IS_AND_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_AND_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/and_eq.hpp b/include/boost/contract/ext_/preprocessor/keyword/and_eq.hpp index 413d6da..88c4579 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/and_eq.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/and_eq.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_AND_EQ_ISxand_eq (1) -#define and_eqxBOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_REMOVExand_eq -#define and_eqxBOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_CAT_TO_COMMAand_eq , +#define and_eqBOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_CAT_TO_EMPTYand_eq +#define and_eqBOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_AND_EQ_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_AND_EQ_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_AND_EQ_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_AND_EQ_FRONT`). +// Precondition: tokens must start with `and_eq` (this can be +// checked with `..._IS_AND_EQ_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_AND_EQ_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_REMOVE) +// Precondition: tokens must end with `and_eq` (this can be +// checked with `..._IS_AND_EQ_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_AND_EQ_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/asm.hpp b/include/boost/contract/ext_/preprocessor/keyword/asm.hpp index 6d411d7..ef3a17a 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/asm.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/asm.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_ASM_ISxasm (1) -#define asmxBOOST_CONTRACT_EXT_PP_KEYWORD_ASM_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_REMOVExasm -#define asmxBOOST_CONTRACT_EXT_PP_KEYWORD_ASM_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_CAT_TO_COMMAasm , +#define asmBOOST_CONTRACT_EXT_PP_KEYWORD_ASM_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_CAT_TO_EMPTYasm +#define asmBOOST_CONTRACT_EXT_PP_KEYWORD_ASM_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ASM_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ASM_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_ASM_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ASM_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_ASM_FRONT`). +// Precondition: tokens must start with `asm` (this can be +// checked with `..._IS_ASM_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_ASM_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_ASM_REMOVE) +// Precondition: tokens must end with `asm` (this can be +// checked with `..._IS_ASM_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_ASM_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/auto.hpp b/include/boost/contract/ext_/preprocessor/keyword/auto.hpp index 21561ea..525bf1e 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/auto.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/auto.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_AUTO_ISxauto (1) -#define autoxBOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_REMOVExauto -#define autoxBOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_CAT_TO_COMMAauto , +#define autoBOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_CAT_TO_EMPTYauto +#define autoBOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_AUTO_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_AUTO_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_AUTO_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_AUTO_FRONT`). +// Precondition: tokens must start with `auto` (this can be +// checked with `..._IS_AUTO_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_AUTO_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_REMOVE) +// Precondition: tokens must end with `auto` (this can be +// checked with `..._IS_AUTO_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_AUTO_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/bitand.hpp b/include/boost/contract/ext_/preprocessor/keyword/bitand.hpp index 82a6640..03d4775 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/bitand.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/bitand.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_BITAND_ISxbitand (1) -#define bitandxBOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_REMOVExbitand -#define bitandxBOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_CAT_TO_COMMAbitand , +#define bitandBOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_CAT_TO_EMPTYbitand +#define bitandBOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BITAND_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BITAND_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BITAND_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_BITAND_FRONT`). +// Precondition: tokens must start with `bitand` (this can be +// checked with `..._IS_BITAND_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_BITAND_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_REMOVE) +// Precondition: tokens must end with `bitand` (this can be +// checked with `..._IS_BITAND_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_BITAND_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/bitor.hpp b/include/boost/contract/ext_/preprocessor/keyword/bitor.hpp index a406709..5db8779 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/bitor.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/bitor.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_BITOR_ISxbitor (1) -#define bitorxBOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_REMOVExbitor -#define bitorxBOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_CAT_TO_COMMAbitor , +#define bitorBOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_CAT_TO_EMPTYbitor +#define bitorBOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BITOR_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BITOR_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BITOR_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_BITOR_FRONT`). +// Precondition: tokens must start with `bitor` (this can be +// checked with `..._IS_BITOR_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_BITOR_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_REMOVE) +// Precondition: tokens must end with `bitor` (this can be +// checked with `..._IS_BITOR_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_BITOR_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/bool.hpp b/include/boost/contract/ext_/preprocessor/keyword/bool.hpp index d4c697c..90feb01 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/bool.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/bool.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_BOOL_ISxbool (1) -#define boolxBOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_REMOVExbool -#define boolxBOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_CAT_TO_COMMAbool , +#define boolBOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_CAT_TO_EMPTYbool +#define boolBOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BOOL_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BOOL_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BOOL_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_BOOL_FRONT`). +// Precondition: tokens must start with `bool` (this can be +// checked with `..._IS_BOOL_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_BOOL_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_REMOVE) +// Precondition: tokens must end with `bool` (this can be +// checked with `..._IS_BOOL_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_BOOL_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/break.hpp b/include/boost/contract/ext_/preprocessor/keyword/break.hpp index 8233ad8..ce79c7f 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/break.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/break.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_BREAK_ISxbreak (1) -#define breakxBOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_REMOVExbreak -#define breakxBOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_CAT_TO_COMMAbreak , +#define breakBOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_CAT_TO_EMPTYbreak +#define breakBOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BREAK_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BREAK_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_BREAK_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_BREAK_FRONT`). +// Precondition: tokens must start with `break` (this can be +// checked with `..._IS_BREAK_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_BREAK_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_REMOVE) +// Precondition: tokens must end with `break` (this can be +// checked with `..._IS_BREAK_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_BREAK_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/case.hpp b/include/boost/contract/ext_/preprocessor/keyword/case.hpp index 8ec6194..8af503e 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/case.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/case.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_CASE_ISxcase (1) -#define casexBOOST_CONTRACT_EXT_PP_KEYWORD_CASE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_REMOVExcase -#define casexBOOST_CONTRACT_EXT_PP_KEYWORD_CASE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_CAT_TO_COMMAcase , +#define caseBOOST_CONTRACT_EXT_PP_KEYWORD_CASE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_CAT_TO_EMPTYcase +#define caseBOOST_CONTRACT_EXT_PP_KEYWORD_CASE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CASE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CASE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_CASE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CASE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_CASE_FRONT`). +// Precondition: tokens must start with `case` (this can be +// checked with `..._IS_CASE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_CASE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_CASE_REMOVE) +// Precondition: tokens must end with `case` (this can be +// checked with `..._IS_CASE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_CASE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/catch.hpp b/include/boost/contract/ext_/preprocessor/keyword/catch.hpp index b54e0c9..c094eaf 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/catch.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/catch.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_CATCH_ISxcatch (1) -#define catchxBOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_REMOVExcatch -#define catchxBOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_CAT_TO_COMMAcatch , +#define catchBOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_CAT_TO_EMPTYcatch +#define catchBOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CATCH_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CATCH_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CATCH_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_CATCH_FRONT`). +// Precondition: tokens must start with `catch` (this can be +// checked with `..._IS_CATCH_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_CATCH_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_REMOVE) +// Precondition: tokens must end with `catch` (this can be +// checked with `..._IS_CATCH_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_CATCH_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/char.hpp b/include/boost/contract/ext_/preprocessor/keyword/char.hpp index 40fb490..c64b6ca 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/char.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/char.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_CHAR_ISxchar (1) -#define charxBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_REMOVExchar -#define charxBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_CAT_TO_COMMAchar , +#define charBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_CAT_TO_EMPTYchar +#define charBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CHAR_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CHAR_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CHAR_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_CHAR_FRONT`). +// Precondition: tokens must start with `char` (this can be +// checked with `..._IS_CHAR_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_CHAR_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_REMOVE) +// Precondition: tokens must end with `char` (this can be +// checked with `..._IS_CHAR_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/char16_t.hpp b/include/boost/contract/ext_/preprocessor/keyword/char16_t.hpp index 708672c..865d442 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/char16_t.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/char16_t.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_CHAR16_T_ISxchar16_t (1) -#define char16_txBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_REMOVExchar16_t -#define char16_txBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_CAT_TO_COMMAchar16_t , +#define char16_tBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_CAT_TO_EMPTYchar16_t +#define char16_tBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CHAR16_T_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CHAR16_T_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CHAR16_T_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_CHAR16_T_FRONT`). +// Precondition: tokens must start with `char16_t` (this can be +// checked with `..._IS_CHAR16_T_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_CHAR16_T_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_REMOVE) +// Precondition: tokens must end with `char16_t` (this can be +// checked with `..._IS_CHAR16_T_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR16_T_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/char32_t.hpp b/include/boost/contract/ext_/preprocessor/keyword/char32_t.hpp index 13e6ba8..25588c9 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/char32_t.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/char32_t.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_CHAR32_T_ISxchar32_t (1) -#define char32_txBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_REMOVExchar32_t -#define char32_txBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_CAT_TO_COMMAchar32_t , +#define char32_tBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_CAT_TO_EMPTYchar32_t +#define char32_tBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CHAR32_T_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CHAR32_T_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CHAR32_T_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_CHAR32_T_FRONT`). +// Precondition: tokens must start with `char32_t` (this can be +// checked with `..._IS_CHAR32_T_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_CHAR32_T_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_REMOVE) +// Precondition: tokens must end with `char32_t` (this can be +// checked with `..._IS_CHAR32_T_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_CHAR32_T_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/class.hpp b/include/boost/contract/ext_/preprocessor/keyword/class.hpp index ead0e00..2311eeb 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/class.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/class.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_CLASS_ISxclass (1) -#define classxBOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_REMOVExclass -#define classxBOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_CAT_TO_COMMAclass , +#define classBOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_CAT_TO_EMPTYclass +#define classBOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CLASS_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CLASS_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CLASS_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_CLASS_FRONT`). +// Precondition: tokens must start with `class` (this can be +// checked with `..._IS_CLASS_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_CLASS_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_REMOVE) +// Precondition: tokens must end with `class` (this can be +// checked with `..._IS_CLASS_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_CLASS_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/compl.hpp b/include/boost/contract/ext_/preprocessor/keyword/compl.hpp index 662d9a4..1da6756 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/compl.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/compl.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_COMPL_ISxcompl (1) -#define complxBOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_REMOVExcompl -#define complxBOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_CAT_TO_COMMAcompl , +#define complBOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_CAT_TO_EMPTYcompl +#define complBOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_COMPL_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_COMPL_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_COMPL_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_COMPL_FRONT`). +// Precondition: tokens must start with `compl` (this can be +// checked with `..._IS_COMPL_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_COMPL_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_REMOVE) +// Precondition: tokens must end with `compl` (this can be +// checked with `..._IS_COMPL_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_COMPL_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/const.hpp b/include/boost/contract/ext_/preprocessor/keyword/const.hpp index 5aa9154..4132198 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/const.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/const.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_CONST_ISxconst (1) -#define constxBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_REMOVExconst -#define constxBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAT_TO_COMMAconst , +#define constBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAT_TO_EMPTYconst +#define constBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONST_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONST_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONST_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_CONST_FRONT`). +// Precondition: tokens must start with `const` (this can be +// checked with `..._IS_CONST_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_CONST_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_REMOVE) +// Precondition: tokens must end with `const` (this can be +// checked with `..._IS_CONST_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/const_cast.hpp b/include/boost/contract/ext_/preprocessor/keyword/const_cast.hpp index 90b0825..286b0b0 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/const_cast.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/const_cast.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_CONST_CAST_ISxconst_cast (1) -#define const_castxBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_REMOVExconst_cast -#define const_castxBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_CAT_TO_COMMAconst_cast , +#define const_castBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_CAT_TO_EMPTYconst_cast +#define const_castBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONST_CAST_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONST_CAST_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONST_CAST_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_CONST_CAST_FRONT`). +// Precondition: tokens must start with `const_cast` (this can be +// checked with `..._IS_CONST_CAST_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_CONST_CAST_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_REMOVE) +// Precondition: tokens must end with `const_cast` (this can be +// checked with `..._IS_CONST_CAST_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_CONST_CAST_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/constexpr.hpp b/include/boost/contract/ext_/preprocessor/keyword/constexpr.hpp index 18088a9..f345473 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/constexpr.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/constexpr.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_CONSTEXPR_ISxconstexpr (1) -#define constexprxBOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_REMOVExconstexpr -#define constexprxBOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_CAT_TO_COMMAconstexpr , +#define constexprBOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_CAT_TO_EMPTYconstexpr +#define constexprBOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONSTEXPR_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONSTEXPR_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONSTEXPR_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_CONSTEXPR_FRONT`). +// Precondition: tokens must start with `constexpr` (this can be +// checked with `..._IS_CONSTEXPR_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_CONSTEXPR_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_REMOVE) +// Precondition: tokens must end with `constexpr` (this can be +// checked with `..._IS_CONSTEXPR_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_CONSTEXPR_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/continue.hpp b/include/boost/contract/ext_/preprocessor/keyword/continue.hpp index f2156cd..0391c8c 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/continue.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/continue.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_CONTINUE_ISxcontinue (1) -#define continuexBOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_REMOVExcontinue -#define continuexBOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_CAT_TO_COMMAcontinue , +#define continueBOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_CAT_TO_EMPTYcontinue +#define continueBOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONTINUE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONTINUE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_CONTINUE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_CONTINUE_FRONT`). +// Precondition: tokens must start with `continue` (this can be +// checked with `..._IS_CONTINUE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_CONTINUE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_REMOVE) +// Precondition: tokens must end with `continue` (this can be +// checked with `..._IS_CONTINUE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_CONTINUE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/contract/extends.hpp b/include/boost/contract/ext_/preprocessor/keyword/contract/extends.hpp index a96bc2e..de8fdc0 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/contract/extends.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/contract/extends.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_EXTENDS_ISxextends (1) -#define extendsxBOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_REMOVExextends -#define extendsxBOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_CAT_TO_COMMAextends , +#define extendsBOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_CAT_TO_EMPTYextends +#define extendsBOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXTENDS_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXTENDS_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXTENDS_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_EXTENDS_FRONT`). +// Precondition: tokens must start with `extends` (this can be +// checked with `..._IS_EXTENDS_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_EXTENDS_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_REMOVE) +// Precondition: tokens must end with `extends` (this can be +// checked with `..._IS_EXTENDS_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_EXTENDS_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/contract/invariant.hpp b/include/boost/contract/ext_/preprocessor/keyword/contract/invariant.hpp index ddb86af..06e6ab6 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/contract/invariant.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/contract/invariant.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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 +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_CAT_TO_COMMAinvariant , +#define invariantBOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_CAT_TO_EMPTYinvariant +#define invariantBOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #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) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_CAT_TO_COMMA, tokens) -#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 must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_INVARIANT_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_INVARIANT_FRONT`). +// Precondition: tokens must start with `invariant` (this can be +// checked with `..._IS_INVARIANT_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_CAT_TO_EMPTY, 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) +// Precondition: tokens must end with `invariant` (this can be +// checked with `..._IS_INVARIANT_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/contract/postcondition.hpp b/include/boost/contract/ext_/preprocessor/keyword/contract/postcondition.hpp index 8554fc8..1d529ce 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/contract/postcondition.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/contract/postcondition.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_POSTCONDITION_ISxpostcondition (1) -#define postconditionxBOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_REMOVExpostcondition -#define postconditionxBOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_CAT_TO_COMMApostcondition , +#define postconditionBOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_CAT_TO_EMPTYpostcondition +#define postconditionBOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_POSTCONDITION_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_POSTCONDITION_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_POSTCONDITION_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_POSTCONDITION_FRONT`). +// Precondition: tokens must start with `postcondition` (this can be +// checked with `..._IS_POSTCONDITION_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_POSTCONDITION_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_REMOVE) +// Precondition: tokens must end with `postcondition` (this can be +// checked with `..._IS_POSTCONDITION_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_POSTCONDITION_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/contract/precondition.hpp b/include/boost/contract/ext_/preprocessor/keyword/contract/precondition.hpp index 582264a..c8d8060 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/contract/precondition.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/contract/precondition.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_PRECONDITION_ISxprecondition (1) -#define preconditionxBOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_REMOVExprecondition -#define preconditionxBOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_CAT_TO_COMMAprecondition , +#define preconditionBOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_CAT_TO_EMPTYprecondition +#define preconditionBOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PRECONDITION_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PRECONDITION_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PRECONDITION_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_PRECONDITION_FRONT`). +// Precondition: tokens must start with `precondition` (this can be +// checked with `..._IS_PRECONDITION_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_PRECONDITION_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_REMOVE) +// Precondition: tokens must end with `precondition` (this can be +// checked with `..._IS_PRECONDITION_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_PRECONDITION_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/contract/verbatim.hpp b/include/boost/contract/ext_/preprocessor/keyword/contract/verbatim.hpp index 3589081..7fd3e45 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/contract/verbatim.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/contract/verbatim.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_VERBATIM_ISxverbatim (1) -#define verbatimxBOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_REMOVExverbatim -#define verbatimxBOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_CAT_TO_COMMAverbatim , +#define verbatimBOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_CAT_TO_EMPTYverbatim +#define verbatimBOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VERBATIM_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VERBATIM_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VERBATIM_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_VERBATIM_FRONT`). +// Precondition: tokens must start with `verbatim` (this can be +// checked with `..._IS_VERBATIM_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_VERBATIM_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_REMOVE) +// Precondition: tokens must end with `verbatim` (this can be +// checked with `..._IS_VERBATIM_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_VERBATIM_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/decltype.hpp b/include/boost/contract/ext_/preprocessor/keyword/decltype.hpp index 3b71f47..9b1867e 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/decltype.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/decltype.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_DECLTYPE_ISxdecltype (1) -#define decltypexBOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_REMOVExdecltype -#define decltypexBOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_CAT_TO_COMMAdecltype , +#define decltypeBOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_CAT_TO_EMPTYdecltype +#define decltypeBOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DECLTYPE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DECLTYPE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DECLTYPE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_DECLTYPE_FRONT`). +// Precondition: tokens must start with `decltype` (this can be +// checked with `..._IS_DECLTYPE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_DECLTYPE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_REMOVE) +// Precondition: tokens must end with `decltype` (this can be +// checked with `..._IS_DECLTYPE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_DECLTYPE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/default.hpp b/include/boost/contract/ext_/preprocessor/keyword/default.hpp index eaf2368..4f6af30 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/default.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/default.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_DEFAULT_ISxdefault (1) -#define defaultxBOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_REMOVExdefault -#define defaultxBOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_CAT_TO_COMMAdefault , +#define defaultBOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_CAT_TO_EMPTYdefault +#define defaultBOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DEFAULT_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DEFAULT_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DEFAULT_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_DEFAULT_FRONT`). +// Precondition: tokens must start with `default` (this can be +// checked with `..._IS_DEFAULT_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_DEFAULT_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_REMOVE) +// Precondition: tokens must end with `default` (this can be +// checked with `..._IS_DEFAULT_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_DEFAULT_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/delete.hpp b/include/boost/contract/ext_/preprocessor/keyword/delete.hpp index 305bfed..644362d 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/delete.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/delete.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_DELETE_ISxdelete (1) -#define deletexBOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_REMOVExdelete -#define deletexBOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_CAT_TO_COMMAdelete , +#define deleteBOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_CAT_TO_EMPTYdelete +#define deleteBOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DELETE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DELETE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DELETE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_DELETE_FRONT`). +// Precondition: tokens must start with `delete` (this can be +// checked with `..._IS_DELETE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_DELETE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_REMOVE) +// Precondition: tokens must end with `delete` (this can be +// checked with `..._IS_DELETE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_DELETE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/do.hpp b/include/boost/contract/ext_/preprocessor/keyword/do.hpp index fb6bf99..ad45d9d 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/do.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/do.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_DO_ISxdo (1) -#define doxBOOST_CONTRACT_EXT_PP_KEYWORD_DO_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DO_REMOVExdo -#define doxBOOST_CONTRACT_EXT_PP_KEYWORD_DO_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DO_CAT_TO_COMMAdo , +#define doBOOST_CONTRACT_EXT_PP_KEYWORD_DO_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DO_CAT_TO_EMPTYdo +#define doBOOST_CONTRACT_EXT_PP_KEYWORD_DO_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DO_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_DO_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DO_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DO_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_DO_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DO_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DO_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_DO_FRONT`). +// Precondition: tokens must start with `do` (this can be +// checked with `..._IS_DO_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_DO_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DO_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DO_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_DO_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DO_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_DO_REMOVE) +// Precondition: tokens must end with `do` (this can be +// checked with `..._IS_DO_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DO_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_DO_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/double.hpp b/include/boost/contract/ext_/preprocessor/keyword/double.hpp index 3ecf880..26bc95c 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/double.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/double.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_DOUBLE_ISxdouble (1) -#define doublexBOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_REMOVExdouble -#define doublexBOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_CAT_TO_COMMAdouble , +#define doubleBOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_CAT_TO_EMPTYdouble +#define doubleBOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DOUBLE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DOUBLE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DOUBLE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_DOUBLE_FRONT`). +// Precondition: tokens must start with `double` (this can be +// checked with `..._IS_DOUBLE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_DOUBLE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_REMOVE) +// Precondition: tokens must end with `double` (this can be +// checked with `..._IS_DOUBLE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_DOUBLE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/dynamic_cast.hpp b/include/boost/contract/ext_/preprocessor/keyword/dynamic_cast.hpp index 1610e7a..1167c85 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/dynamic_cast.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/dynamic_cast.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_DYNAMIC_CAST_ISxdynamic_cast (1) -#define dynamic_castxBOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_REMOVExdynamic_cast -#define dynamic_castxBOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_CAT_TO_COMMAdynamic_cast , +#define dynamic_castBOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_CAT_TO_EMPTYdynamic_cast +#define dynamic_castBOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DYNAMIC_CAST_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DYNAMIC_CAST_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_DYNAMIC_CAST_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_DYNAMIC_CAST_FRONT`). +// Precondition: tokens must start with `dynamic_cast` (this can be +// checked with `..._IS_DYNAMIC_CAST_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_DYNAMIC_CAST_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_REMOVE) +// Precondition: tokens must end with `dynamic_cast` (this can be +// checked with `..._IS_DYNAMIC_CAST_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_DYNAMIC_CAST_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/else.hpp b/include/boost/contract/ext_/preprocessor/keyword/else.hpp index 7249714..b1bcaf8 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/else.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/else.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_ELSE_ISxelse (1) -#define elsexBOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_REMOVExelse -#define elsexBOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_CAT_TO_COMMAelse , +#define elseBOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_CAT_TO_EMPTYelse +#define elseBOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ELSE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ELSE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ELSE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_ELSE_FRONT`). +// Precondition: tokens must start with `else` (this can be +// checked with `..._IS_ELSE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_ELSE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_REMOVE) +// Precondition: tokens must end with `else` (this can be +// checked with `..._IS_ELSE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_ELSE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/enum.hpp b/include/boost/contract/ext_/preprocessor/keyword/enum.hpp index 2ad0b11..bed2840 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/enum.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/enum.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_ENUM_ISxenum (1) -#define enumxBOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_REMOVExenum -#define enumxBOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_CAT_TO_COMMAenum , +#define enumBOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_CAT_TO_EMPTYenum +#define enumBOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ENUM_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ENUM_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_ENUM_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_ENUM_FRONT`). +// Precondition: tokens must start with `enum` (this can be +// checked with `..._IS_ENUM_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_ENUM_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_REMOVE) +// Precondition: tokens must end with `enum` (this can be +// checked with `..._IS_ENUM_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_ENUM_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/explicit.hpp b/include/boost/contract/ext_/preprocessor/keyword/explicit.hpp index 69dfce6..bf99a15 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/explicit.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/explicit.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_EXPLICIT_ISxexplicit (1) -#define explicitxBOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_REMOVExexplicit -#define explicitxBOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_CAT_TO_COMMAexplicit , +#define explicitBOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_CAT_TO_EMPTYexplicit +#define explicitBOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXPLICIT_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXPLICIT_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXPLICIT_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_EXPLICIT_FRONT`). +// Precondition: tokens must start with `explicit` (this can be +// checked with `..._IS_EXPLICIT_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_EXPLICIT_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_REMOVE) +// Precondition: tokens must end with `explicit` (this can be +// checked with `..._IS_EXPLICIT_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_EXPLICIT_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/export.hpp b/include/boost/contract/ext_/preprocessor/keyword/export.hpp index af774d5..349de10 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/export.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/export.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_EXPORT_ISxexport (1) -#define exportxBOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_REMOVExexport -#define exportxBOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_CAT_TO_COMMAexport , +#define exportBOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_CAT_TO_EMPTYexport +#define exportBOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXPORT_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXPORT_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXPORT_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_EXPORT_FRONT`). +// Precondition: tokens must start with `export` (this can be +// checked with `..._IS_EXPORT_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_EXPORT_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_REMOVE) +// Precondition: tokens must end with `export` (this can be +// checked with `..._IS_EXPORT_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_EXPORT_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/extern.hpp b/include/boost/contract/ext_/preprocessor/keyword/extern.hpp index 16ed044..d3813f7 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/extern.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/extern.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_EXTERN_ISxextern (1) -#define externxBOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_REMOVExextern -#define externxBOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_CAT_TO_COMMAextern , +#define externBOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_CAT_TO_EMPTYextern +#define externBOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXTERN_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXTERN_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_EXTERN_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_EXTERN_FRONT`). +// Precondition: tokens must start with `extern` (this can be +// checked with `..._IS_EXTERN_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_EXTERN_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_REMOVE) +// Precondition: tokens must end with `extern` (this can be +// checked with `..._IS_EXTERN_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_EXTERN_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/false.hpp b/include/boost/contract/ext_/preprocessor/keyword/false.hpp index 9e6f72f..bd692ac 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/false.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/false.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_FALSE_ISxfalse (1) -#define falsexBOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_REMOVExfalse -#define falsexBOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_CAT_TO_COMMAfalse , +#define falseBOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_CAT_TO_EMPTYfalse +#define falseBOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FALSE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FALSE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FALSE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_FALSE_FRONT`). +// Precondition: tokens must start with `false` (this can be +// checked with `..._IS_FALSE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_FALSE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_REMOVE) +// Precondition: tokens must end with `false` (this can be +// checked with `..._IS_FALSE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_FALSE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/final.hpp b/include/boost/contract/ext_/preprocessor/keyword/final.hpp index ebb7d9f..d26df9b 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/final.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/final.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_FINAL_ISxfinal (1) -#define finalxBOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_REMOVExfinal -#define finalxBOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_CAT_TO_COMMAfinal , +#define finalBOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_CAT_TO_EMPTYfinal +#define finalBOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FINAL_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FINAL_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FINAL_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_FINAL_FRONT`). +// Precondition: tokens must start with `final` (this can be +// checked with `..._IS_FINAL_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_FINAL_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_REMOVE) +// Precondition: tokens must end with `final` (this can be +// checked with `..._IS_FINAL_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_FINAL_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/float.hpp b/include/boost/contract/ext_/preprocessor/keyword/float.hpp index 05e6251..4ef45e7 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/float.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/float.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_FLOAT_ISxfloat (1) -#define floatxBOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_REMOVExfloat -#define floatxBOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_CAT_TO_COMMAfloat , +#define floatBOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_CAT_TO_EMPTYfloat +#define floatBOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FLOAT_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FLOAT_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FLOAT_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_FLOAT_FRONT`). +// Precondition: tokens must start with `float` (this can be +// checked with `..._IS_FLOAT_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_FLOAT_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_REMOVE) +// Precondition: tokens must end with `float` (this can be +// checked with `..._IS_FLOAT_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_FLOAT_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/for.hpp b/include/boost/contract/ext_/preprocessor/keyword/for.hpp index f7e614f..8cd0eaa 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/for.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/for.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_FOR_ISxfor (1) -#define forxBOOST_CONTRACT_EXT_PP_KEYWORD_FOR_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_REMOVExfor -#define forxBOOST_CONTRACT_EXT_PP_KEYWORD_FOR_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_CAT_TO_COMMAfor , +#define forBOOST_CONTRACT_EXT_PP_KEYWORD_FOR_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_CAT_TO_EMPTYfor +#define forBOOST_CONTRACT_EXT_PP_KEYWORD_FOR_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FOR_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FOR_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_FOR_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FOR_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_FOR_FRONT`). +// Precondition: tokens must start with `for` (this can be +// checked with `..._IS_FOR_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_FOR_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_FOR_REMOVE) +// Precondition: tokens must end with `for` (this can be +// checked with `..._IS_FOR_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_FOR_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/friend.hpp b/include/boost/contract/ext_/preprocessor/keyword/friend.hpp index f73708e..b732cac 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/friend.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/friend.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_FRIEND_ISxfriend (1) -#define friendxBOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_REMOVExfriend -#define friendxBOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_CAT_TO_COMMAfriend , +#define friendBOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_CAT_TO_EMPTYfriend +#define friendBOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FRIEND_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FRIEND_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_FRIEND_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_FRIEND_FRONT`). +// Precondition: tokens must start with `friend` (this can be +// checked with `..._IS_FRIEND_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_FRIEND_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_REMOVE) +// Precondition: tokens must end with `friend` (this can be +// checked with `..._IS_FRIEND_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_FRIEND_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/generate.py b/include/boost/contract/ext_/preprocessor/keyword/generate.py index 18c4b59..c2dbcf6 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/generate.py +++ b/include/boost/contract/ext_/preprocessor/keyword/generate.py @@ -12,13 +12,102 @@ entries = [ { 'directory': '.', 'keywords': [ -'alignas', 'alignof', 'and', 'and_eq', 'asm', 'auto', 'bitand', 'bitor', 'bool', 'break', 'case', 'catch', 'char', 'char16_t', 'char32_t', 'class', 'compl', 'const', 'constexpr', 'const_cast', 'continue', 'decltype', 'default', 'delete', 'do', 'double', 'dynamic_cast', 'else', 'enum', 'explicit', 'export', 'extern', 'false', 'final', 'float', 'for', 'friend', 'goto', 'if', 'inline', 'int', 'long', 'mutable', 'namespace', 'new', 'noexcept', 'not', 'not_eq', 'nullptr', 'operator', 'or', 'or_eq', 'override', 'private', 'protected', 'public', 'register', 'reinterpret_cast', 'return', 'short', 'signed', 'sizeof', 'static', 'static_assert', 'static_cast', 'struct', 'switch', 'template', 'this', 'thread_local', 'throw', 'true', 'try', 'typedef', 'typeid', 'typename', 'union', 'unsigned', 'using', 'virtual', 'void', 'volatile', 'wchar_t', 'while', 'xor', 'xor_eq' + 'alignas', + 'alignof', + 'and', + 'and_eq', + 'asm', + 'auto', + 'bitand', + 'bitor', + 'bool', + 'break', + 'case', + 'catch', + 'char', + 'char16_t', + 'char32_t', + 'class', + 'compl', + 'const', + 'constexpr', + 'const_cast', + 'continue', + 'decltype', + 'default', + 'delete', + 'do', + 'double', + 'dynamic_cast', + 'else', + 'enum', + 'explicit', + 'export', + 'extern', + 'false', + 'final', + 'float', + 'for', + 'friend', + 'goto', + 'if', + 'inline', + 'int', + 'long', + 'mutable', + 'namespace', + 'new', + 'noexcept', + 'not', + 'not_eq', + 'nullptr', + 'operator', + 'or', + 'or_eq', + 'override', + 'private', + 'protected', + 'public', + 'register', + 'reinterpret_cast', + 'return', + 'short', + 'signed', + 'sizeof', + 'static', + 'static_assert', + 'static_cast', + 'struct', + 'switch', + 'template', + 'this', + 'thread_local', + 'throw', + 'true', + 'try', + 'typedef', + 'typeid', + 'typename', + 'union', + 'unsigned', + 'using', + 'virtual', + 'void', + 'volatile', + 'wchar_t', + 'while', + 'xor', + 'xor_eq' ] }, { 'directory': 'contract', 'keywords': [ -'invariant', 'precondition', 'postcondition', 'extends', 'verbatim' + 'invariant', + 'precondition', + 'postcondition', + 'extends', + 'verbatim' ] } ] @@ -44,34 +133,38 @@ for entry in entries: #include #include -// PRIVATE // +/* 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_{1}_ISx{2} (1) -#define {2}xBOOST_CONTRACT_EXT_PP_KEYWORD_{1}_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_REMOVEx{2} -#define {2}xBOOST_CONTRACT_EXT_PP_KEYWORD_{1}_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_CAT_TO_COMMA{2} , +#define {2}BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_CAT_TO_EMPTY{2} +#define {2}BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_{1}_FRONT(tokens) \\ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \\ - BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \\ + BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_{1}_BACK(token) \\ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \\ - xBOOST_CONTRACT_EXT_PP_KEYWORD_{1}_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_{1}_BACK(tokens) \\ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \\ + BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_{1}_FRONT`). +// Precondition: tokens must start with `{2}` (this can be +// checked with `..._IS_{1}_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_REMOVE_FRONT(tokens) \\ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_{1}_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_REMOVE_BACK(token) \\ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_{1}_REMOVE) +// Precondition: tokens must end with `{2}` (this can be +// checked with `..._IS_{1}_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_REMOVE_BACK(tokens) \\ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_{1}_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/goto.hpp b/include/boost/contract/ext_/preprocessor/keyword/goto.hpp index 4facf22..55997c6 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/goto.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/goto.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_GOTO_ISxgoto (1) -#define gotoxBOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_REMOVExgoto -#define gotoxBOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_CAT_TO_COMMAgoto , +#define gotoBOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_CAT_TO_EMPTYgoto +#define gotoBOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_GOTO_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_GOTO_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_GOTO_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_GOTO_FRONT`). +// Precondition: tokens must start with `goto` (this can be +// checked with `..._IS_GOTO_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_GOTO_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_REMOVE) +// Precondition: tokens must end with `goto` (this can be +// checked with `..._IS_GOTO_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_GOTO_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/if.hpp b/include/boost/contract/ext_/preprocessor/keyword/if.hpp index c3bb69f..6cc939c 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/if.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/if.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_IF_ISxif (1) -#define ifxBOOST_CONTRACT_EXT_PP_KEYWORD_IF_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IF_REMOVExif -#define ifxBOOST_CONTRACT_EXT_PP_KEYWORD_IF_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IF_CAT_TO_COMMAif , +#define ifBOOST_CONTRACT_EXT_PP_KEYWORD_IF_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IF_CAT_TO_EMPTYif +#define ifBOOST_CONTRACT_EXT_PP_KEYWORD_IF_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_IF_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_IF_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_IF_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_IF_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_IF_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_IF_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_IF_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_IF_FRONT`). +// Precondition: tokens must start with `if` (this can be +// checked with `..._IS_IF_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_IF_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_IF_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_IF_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_IF_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IF_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_IF_REMOVE) +// Precondition: tokens must end with `if` (this can be +// checked with `..._IS_IF_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IF_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_IF_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/inline.hpp b/include/boost/contract/ext_/preprocessor/keyword/inline.hpp index bd58b45..45c2260 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/inline.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/inline.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_INLINE_ISxinline (1) -#define inlinexBOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_REMOVExinline -#define inlinexBOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_CAT_TO_COMMAinline , +#define inlineBOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_CAT_TO_EMPTYinline +#define inlineBOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_INLINE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_INLINE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_INLINE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_INLINE_FRONT`). +// Precondition: tokens must start with `inline` (this can be +// checked with `..._IS_INLINE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_INLINE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_REMOVE) +// Precondition: tokens must end with `inline` (this can be +// checked with `..._IS_INLINE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_INLINE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/int.hpp b/include/boost/contract/ext_/preprocessor/keyword/int.hpp index 39ec171..3dffd65 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/int.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/int.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_INT_ISxint (1) -#define intxBOOST_CONTRACT_EXT_PP_KEYWORD_INT_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_INT_REMOVExint -#define intxBOOST_CONTRACT_EXT_PP_KEYWORD_INT_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INT_CAT_TO_COMMAint , +#define intBOOST_CONTRACT_EXT_PP_KEYWORD_INT_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INT_CAT_TO_EMPTYint +#define intBOOST_CONTRACT_EXT_PP_KEYWORD_INT_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_INT_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_INT_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_INT_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_INT_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_INT_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_INT_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_INT_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_INT_FRONT`). +// Precondition: tokens must start with `int` (this can be +// checked with `..._IS_INT_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_INT_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_INT_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_INT_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_INT_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_INT_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_INT_REMOVE) +// Precondition: tokens must end with `int` (this can be +// checked with `..._IS_INT_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INT_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_INT_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/long.hpp b/include/boost/contract/ext_/preprocessor/keyword/long.hpp index 6e7ca9a..14b62b6 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/long.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/long.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_LONG_ISxlong (1) -#define longxBOOST_CONTRACT_EXT_PP_KEYWORD_LONG_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_REMOVExlong -#define longxBOOST_CONTRACT_EXT_PP_KEYWORD_LONG_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_CAT_TO_COMMAlong , +#define longBOOST_CONTRACT_EXT_PP_KEYWORD_LONG_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_CAT_TO_EMPTYlong +#define longBOOST_CONTRACT_EXT_PP_KEYWORD_LONG_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_LONG_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_LONG_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_LONG_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_LONG_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_LONG_FRONT`). +// Precondition: tokens must start with `long` (this can be +// checked with `..._IS_LONG_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_LONG_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_LONG_REMOVE) +// Precondition: tokens must end with `long` (this can be +// checked with `..._IS_LONG_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_LONG_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/mutable.hpp b/include/boost/contract/ext_/preprocessor/keyword/mutable.hpp index 06f6800..6239af9 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/mutable.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/mutable.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_MUTABLE_ISxmutable (1) -#define mutablexBOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_REMOVExmutable -#define mutablexBOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_CAT_TO_COMMAmutable , +#define mutableBOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_CAT_TO_EMPTYmutable +#define mutableBOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_MUTABLE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_MUTABLE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_MUTABLE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_MUTABLE_FRONT`). +// Precondition: tokens must start with `mutable` (this can be +// checked with `..._IS_MUTABLE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_MUTABLE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_REMOVE) +// Precondition: tokens must end with `mutable` (this can be +// checked with `..._IS_MUTABLE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_MUTABLE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/namespace.hpp b/include/boost/contract/ext_/preprocessor/keyword/namespace.hpp index 58efb76..ac2778b 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/namespace.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/namespace.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_NAMESPACE_ISxnamespace (1) -#define namespacexBOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_REMOVExnamespace -#define namespacexBOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_CAT_TO_COMMAnamespace , +#define namespaceBOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_CAT_TO_EMPTYnamespace +#define namespaceBOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NAMESPACE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NAMESPACE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NAMESPACE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_NAMESPACE_FRONT`). +// Precondition: tokens must start with `namespace` (this can be +// checked with `..._IS_NAMESPACE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_NAMESPACE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_REMOVE) +// Precondition: tokens must end with `namespace` (this can be +// checked with `..._IS_NAMESPACE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_NAMESPACE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/new.hpp b/include/boost/contract/ext_/preprocessor/keyword/new.hpp index a050b38..81c739e 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/new.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/new.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_NEW_ISxnew (1) -#define newxBOOST_CONTRACT_EXT_PP_KEYWORD_NEW_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_REMOVExnew -#define newxBOOST_CONTRACT_EXT_PP_KEYWORD_NEW_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_CAT_TO_COMMAnew , +#define newBOOST_CONTRACT_EXT_PP_KEYWORD_NEW_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_CAT_TO_EMPTYnew +#define newBOOST_CONTRACT_EXT_PP_KEYWORD_NEW_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NEW_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NEW_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_NEW_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NEW_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_NEW_FRONT`). +// Precondition: tokens must start with `new` (this can be +// checked with `..._IS_NEW_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_NEW_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_NEW_REMOVE) +// Precondition: tokens must end with `new` (this can be +// checked with `..._IS_NEW_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_NEW_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/noexcept.hpp b/include/boost/contract/ext_/preprocessor/keyword/noexcept.hpp index 10b96e0..c0852ca 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/noexcept.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/noexcept.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_NOEXCEPT_ISxnoexcept (1) -#define noexceptxBOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_REMOVExnoexcept -#define noexceptxBOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_CAT_TO_COMMAnoexcept , +#define noexceptBOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_CAT_TO_EMPTYnoexcept +#define noexceptBOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NOEXCEPT_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NOEXCEPT_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NOEXCEPT_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_NOEXCEPT_FRONT`). +// Precondition: tokens must start with `noexcept` (this can be +// checked with `..._IS_NOEXCEPT_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_NOEXCEPT_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_REMOVE) +// Precondition: tokens must end with `noexcept` (this can be +// checked with `..._IS_NOEXCEPT_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_NOEXCEPT_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/not.hpp b/include/boost/contract/ext_/preprocessor/keyword/not.hpp index 363e6b4..66ed4b5 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/not.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/not.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_NOT_ISxnot (1) -#define notxBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_REMOVExnot -#define notxBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_CAT_TO_COMMAnot , +#define notBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_CAT_TO_EMPTYnot +#define notBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NOT_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NOT_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NOT_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_NOT_FRONT`). +// Precondition: tokens must start with `not` (this can be +// checked with `..._IS_NOT_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_NOT_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_REMOVE) +// Precondition: tokens must end with `not` (this can be +// checked with `..._IS_NOT_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/not_eq.hpp b/include/boost/contract/ext_/preprocessor/keyword/not_eq.hpp index cf3723a..615aa3d 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/not_eq.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/not_eq.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_NOT_EQ_ISxnot_eq (1) -#define not_eqxBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_REMOVExnot_eq -#define not_eqxBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_CAT_TO_COMMAnot_eq , +#define not_eqBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_CAT_TO_EMPTYnot_eq +#define not_eqBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NOT_EQ_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NOT_EQ_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NOT_EQ_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_NOT_EQ_FRONT`). +// Precondition: tokens must start with `not_eq` (this can be +// checked with `..._IS_NOT_EQ_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_NOT_EQ_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_REMOVE) +// Precondition: tokens must end with `not_eq` (this can be +// checked with `..._IS_NOT_EQ_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_NOT_EQ_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/nullptr.hpp b/include/boost/contract/ext_/preprocessor/keyword/nullptr.hpp index d2c5b9f..c618880 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/nullptr.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/nullptr.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_NULLPTR_ISxnullptr (1) -#define nullptrxBOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_REMOVExnullptr -#define nullptrxBOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_CAT_TO_COMMAnullptr , +#define nullptrBOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_CAT_TO_EMPTYnullptr +#define nullptrBOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NULLPTR_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NULLPTR_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_NULLPTR_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_NULLPTR_FRONT`). +// Precondition: tokens must start with `nullptr` (this can be +// checked with `..._IS_NULLPTR_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_NULLPTR_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_REMOVE) +// Precondition: tokens must end with `nullptr` (this can be +// checked with `..._IS_NULLPTR_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_NULLPTR_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/operator.hpp b/include/boost/contract/ext_/preprocessor/keyword/operator.hpp index dd6bf07..9655e54 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/operator.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/operator.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_OPERATOR_ISxoperator (1) -#define operatorxBOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_REMOVExoperator -#define operatorxBOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_CAT_TO_COMMAoperator , +#define operatorBOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_CAT_TO_EMPTYoperator +#define operatorBOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OPERATOR_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OPERATOR_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OPERATOR_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_OPERATOR_FRONT`). +// Precondition: tokens must start with `operator` (this can be +// checked with `..._IS_OPERATOR_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_OPERATOR_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_REMOVE) +// Precondition: tokens must end with `operator` (this can be +// checked with `..._IS_OPERATOR_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_OPERATOR_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/or.hpp b/include/boost/contract/ext_/preprocessor/keyword/or.hpp index 61c852f..9ddafb3 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/or.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/or.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_OR_ISxor (1) -#define orxBOOST_CONTRACT_EXT_PP_KEYWORD_OR_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_REMOVExor -#define orxBOOST_CONTRACT_EXT_PP_KEYWORD_OR_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_CAT_TO_COMMAor , +#define orBOOST_CONTRACT_EXT_PP_KEYWORD_OR_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_CAT_TO_EMPTYor +#define orBOOST_CONTRACT_EXT_PP_KEYWORD_OR_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OR_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_OR_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_OR_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OR_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_OR_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OR_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_OR_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_OR_FRONT`). +// Precondition: tokens must start with `or` (this can be +// checked with `..._IS_OR_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_OR_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_OR_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_OR_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_OR_REMOVE) +// Precondition: tokens must end with `or` (this can be +// checked with `..._IS_OR_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_OR_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/or_eq.hpp b/include/boost/contract/ext_/preprocessor/keyword/or_eq.hpp index 4bf0d08..9ba5153 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/or_eq.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/or_eq.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_OR_EQ_ISxor_eq (1) -#define or_eqxBOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_REMOVExor_eq -#define or_eqxBOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_CAT_TO_COMMAor_eq , +#define or_eqBOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_CAT_TO_EMPTYor_eq +#define or_eqBOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OR_EQ_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OR_EQ_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OR_EQ_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_OR_EQ_FRONT`). +// Precondition: tokens must start with `or_eq` (this can be +// checked with `..._IS_OR_EQ_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_OR_EQ_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_REMOVE) +// Precondition: tokens must end with `or_eq` (this can be +// checked with `..._IS_OR_EQ_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_OR_EQ_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/override.hpp b/include/boost/contract/ext_/preprocessor/keyword/override.hpp index 6e4ae26..0f611e4 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/override.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/override.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_OVERRIDE_ISxoverride (1) -#define overridexBOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_REMOVExoverride -#define overridexBOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_CAT_TO_COMMAoverride , +#define overrideBOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_CAT_TO_EMPTYoverride +#define overrideBOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OVERRIDE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OVERRIDE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_OVERRIDE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_OVERRIDE_FRONT`). +// Precondition: tokens must start with `override` (this can be +// checked with `..._IS_OVERRIDE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_OVERRIDE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_REMOVE) +// Precondition: tokens must end with `override` (this can be +// checked with `..._IS_OVERRIDE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_OVERRIDE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/private.hpp b/include/boost/contract/ext_/preprocessor/keyword/private.hpp index f83261c..eb1454f 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/private.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/private.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_PRIVATE_ISxprivate (1) -#define privatexBOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_REMOVExprivate -#define privatexBOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_CAT_TO_COMMAprivate , +#define privateBOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_CAT_TO_EMPTYprivate +#define privateBOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PRIVATE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PRIVATE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PRIVATE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_PRIVATE_FRONT`). +// Precondition: tokens must start with `private` (this can be +// checked with `..._IS_PRIVATE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_PRIVATE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_REMOVE) +// Precondition: tokens must end with `private` (this can be +// checked with `..._IS_PRIVATE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_PRIVATE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/protected.hpp b/include/boost/contract/ext_/preprocessor/keyword/protected.hpp index 09c6dc3..d260893 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/protected.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/protected.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_PROTECTED_ISxprotected (1) -#define protectedxBOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_REMOVExprotected -#define protectedxBOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_CAT_TO_COMMAprotected , +#define protectedBOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_CAT_TO_EMPTYprotected +#define protectedBOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PROTECTED_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PROTECTED_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PROTECTED_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_PROTECTED_FRONT`). +// Precondition: tokens must start with `protected` (this can be +// checked with `..._IS_PROTECTED_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_PROTECTED_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_REMOVE) +// Precondition: tokens must end with `protected` (this can be +// checked with `..._IS_PROTECTED_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_PROTECTED_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/public.hpp b/include/boost/contract/ext_/preprocessor/keyword/public.hpp index ef27238..e53ae94 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/public.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/public.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_PUBLIC_ISxpublic (1) -#define publicxBOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_REMOVExpublic -#define publicxBOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_CAT_TO_COMMApublic , +#define publicBOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_CAT_TO_EMPTYpublic +#define publicBOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PUBLIC_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PUBLIC_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_PUBLIC_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_PUBLIC_FRONT`). +// Precondition: tokens must start with `public` (this can be +// checked with `..._IS_PUBLIC_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_PUBLIC_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_REMOVE) +// Precondition: tokens must end with `public` (this can be +// checked with `..._IS_PUBLIC_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_PUBLIC_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/register.hpp b/include/boost/contract/ext_/preprocessor/keyword/register.hpp index 5b63f2b..9e9d75f 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/register.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/register.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_REGISTER_ISxregister (1) -#define registerxBOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_REMOVExregister -#define registerxBOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_CAT_TO_COMMAregister , +#define registerBOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_CAT_TO_EMPTYregister +#define registerBOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_REGISTER_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_REGISTER_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_REGISTER_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_REGISTER_FRONT`). +// Precondition: tokens must start with `register` (this can be +// checked with `..._IS_REGISTER_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_REGISTER_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_REMOVE) +// Precondition: tokens must end with `register` (this can be +// checked with `..._IS_REGISTER_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_REGISTER_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/reinterpret_cast.hpp b/include/boost/contract/ext_/preprocessor/keyword/reinterpret_cast.hpp index 0002906..feea252 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/reinterpret_cast.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/reinterpret_cast.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_REINTERPRET_CAST_ISxreinterpret_cast (1) -#define reinterpret_castxBOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_REMOVExreinterpret_cast -#define reinterpret_castxBOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_CAT_TO_COMMAreinterpret_cast , +#define reinterpret_castBOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_CAT_TO_EMPTYreinterpret_cast +#define reinterpret_castBOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_REINTERPRET_CAST_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_REINTERPRET_CAST_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_REINTERPRET_CAST_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_REINTERPRET_CAST_FRONT`). +// Precondition: tokens must start with `reinterpret_cast` (this can be +// checked with `..._IS_REINTERPRET_CAST_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_REINTERPRET_CAST_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_REMOVE) +// Precondition: tokens must end with `reinterpret_cast` (this can be +// checked with `..._IS_REINTERPRET_CAST_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_REINTERPRET_CAST_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/return.hpp b/include/boost/contract/ext_/preprocessor/keyword/return.hpp index f101954..c0ae05a 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/return.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/return.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_RETURN_ISxreturn (1) -#define returnxBOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_REMOVExreturn -#define returnxBOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_CAT_TO_COMMAreturn , +#define returnBOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_CAT_TO_EMPTYreturn +#define returnBOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_RETURN_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_RETURN_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_RETURN_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_RETURN_FRONT`). +// Precondition: tokens must start with `return` (this can be +// checked with `..._IS_RETURN_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_RETURN_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_REMOVE) +// Precondition: tokens must end with `return` (this can be +// checked with `..._IS_RETURN_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_RETURN_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/short.hpp b/include/boost/contract/ext_/preprocessor/keyword/short.hpp index 5b1635b..1da9974 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/short.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/short.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_SHORT_ISxshort (1) -#define shortxBOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_REMOVExshort -#define shortxBOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_CAT_TO_COMMAshort , +#define shortBOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_CAT_TO_EMPTYshort +#define shortBOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SHORT_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SHORT_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SHORT_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_SHORT_FRONT`). +// Precondition: tokens must start with `short` (this can be +// checked with `..._IS_SHORT_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_SHORT_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_REMOVE) +// Precondition: tokens must end with `short` (this can be +// checked with `..._IS_SHORT_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_SHORT_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/signed.hpp b/include/boost/contract/ext_/preprocessor/keyword/signed.hpp index e4f1fd8..8bc2e3d 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/signed.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/signed.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_SIGNED_ISxsigned (1) -#define signedxBOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_REMOVExsigned -#define signedxBOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_CAT_TO_COMMAsigned , +#define signedBOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_CAT_TO_EMPTYsigned +#define signedBOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SIGNED_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SIGNED_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SIGNED_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_SIGNED_FRONT`). +// Precondition: tokens must start with `signed` (this can be +// checked with `..._IS_SIGNED_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_SIGNED_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_REMOVE) +// Precondition: tokens must end with `signed` (this can be +// checked with `..._IS_SIGNED_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_SIGNED_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/sizeof.hpp b/include/boost/contract/ext_/preprocessor/keyword/sizeof.hpp index c5671bb..131f73c 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/sizeof.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/sizeof.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_SIZEOF_ISxsizeof (1) -#define sizeofxBOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_REMOVExsizeof -#define sizeofxBOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_CAT_TO_COMMAsizeof , +#define sizeofBOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_CAT_TO_EMPTYsizeof +#define sizeofBOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SIZEOF_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SIZEOF_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SIZEOF_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_SIZEOF_FRONT`). +// Precondition: tokens must start with `sizeof` (this can be +// checked with `..._IS_SIZEOF_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_SIZEOF_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_REMOVE) +// Precondition: tokens must end with `sizeof` (this can be +// checked with `..._IS_SIZEOF_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_SIZEOF_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/static.hpp b/include/boost/contract/ext_/preprocessor/keyword/static.hpp index faaa036..6c2c582 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/static.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/static.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_STATIC_ISxstatic (1) -#define staticxBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_REMOVExstatic -#define staticxBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAT_TO_COMMAstatic , +#define staticBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAT_TO_EMPTYstatic +#define staticBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STATIC_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STATIC_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STATIC_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_STATIC_FRONT`). +// Precondition: tokens must start with `static` (this can be +// checked with `..._IS_STATIC_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_STATIC_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_REMOVE) +// Precondition: tokens must end with `static` (this can be +// checked with `..._IS_STATIC_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/static_assert.hpp b/include/boost/contract/ext_/preprocessor/keyword/static_assert.hpp index aec0fa0..92dd334 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/static_assert.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/static_assert.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_STATIC_ASSERT_ISxstatic_assert (1) -#define static_assertxBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_REMOVExstatic_assert -#define static_assertxBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_CAT_TO_COMMAstatic_assert , +#define static_assertBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_CAT_TO_EMPTYstatic_assert +#define static_assertBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STATIC_ASSERT_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STATIC_ASSERT_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STATIC_ASSERT_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_STATIC_ASSERT_FRONT`). +// Precondition: tokens must start with `static_assert` (this can be +// checked with `..._IS_STATIC_ASSERT_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_STATIC_ASSERT_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_REMOVE) +// Precondition: tokens must end with `static_assert` (this can be +// checked with `..._IS_STATIC_ASSERT_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_ASSERT_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/static_cast.hpp b/include/boost/contract/ext_/preprocessor/keyword/static_cast.hpp index c555805..e698623 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/static_cast.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/static_cast.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_STATIC_CAST_ISxstatic_cast (1) -#define static_castxBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_REMOVExstatic_cast -#define static_castxBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_CAT_TO_COMMAstatic_cast , +#define static_castBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_CAT_TO_EMPTYstatic_cast +#define static_castBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STATIC_CAST_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STATIC_CAST_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STATIC_CAST_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_STATIC_CAST_FRONT`). +// Precondition: tokens must start with `static_cast` (this can be +// checked with `..._IS_STATIC_CAST_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_STATIC_CAST_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_REMOVE) +// Precondition: tokens must end with `static_cast` (this can be +// checked with `..._IS_STATIC_CAST_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_STATIC_CAST_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/struct.hpp b/include/boost/contract/ext_/preprocessor/keyword/struct.hpp index ec07d38..f759ad8 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/struct.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/struct.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_STRUCT_ISxstruct (1) -#define structxBOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_REMOVExstruct -#define structxBOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_CAT_TO_COMMAstruct , +#define structBOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_CAT_TO_EMPTYstruct +#define structBOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STRUCT_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STRUCT_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_STRUCT_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_STRUCT_FRONT`). +// Precondition: tokens must start with `struct` (this can be +// checked with `..._IS_STRUCT_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_STRUCT_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_REMOVE) +// Precondition: tokens must end with `struct` (this can be +// checked with `..._IS_STRUCT_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_STRUCT_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/switch.hpp b/include/boost/contract/ext_/preprocessor/keyword/switch.hpp index ed9d2b6..4a93ec2 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/switch.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/switch.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_SWITCH_ISxswitch (1) -#define switchxBOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_REMOVExswitch -#define switchxBOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_CAT_TO_COMMAswitch , +#define switchBOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_CAT_TO_EMPTYswitch +#define switchBOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SWITCH_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SWITCH_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_SWITCH_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_SWITCH_FRONT`). +// Precondition: tokens must start with `switch` (this can be +// checked with `..._IS_SWITCH_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_SWITCH_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_REMOVE) +// Precondition: tokens must end with `switch` (this can be +// checked with `..._IS_SWITCH_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_SWITCH_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/template.hpp b/include/boost/contract/ext_/preprocessor/keyword/template.hpp index a0043f1..06cc71a 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/template.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/template.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_TEMPLATE_ISxtemplate (1) -#define templatexBOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_REMOVExtemplate -#define templatexBOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_CAT_TO_COMMAtemplate , +#define templateBOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_CAT_TO_EMPTYtemplate +#define templateBOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TEMPLATE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TEMPLATE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TEMPLATE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_TEMPLATE_FRONT`). +// Precondition: tokens must start with `template` (this can be +// checked with `..._IS_TEMPLATE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_TEMPLATE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_REMOVE) +// Precondition: tokens must end with `template` (this can be +// checked with `..._IS_TEMPLATE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_TEMPLATE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/this.hpp b/include/boost/contract/ext_/preprocessor/keyword/this.hpp index 1f4ed8e..89eb3f9 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/this.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/this.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_THIS_ISxthis (1) -#define thisxBOOST_CONTRACT_EXT_PP_KEYWORD_THIS_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_REMOVExthis -#define thisxBOOST_CONTRACT_EXT_PP_KEYWORD_THIS_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_CAT_TO_COMMAthis , +#define thisBOOST_CONTRACT_EXT_PP_KEYWORD_THIS_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_CAT_TO_EMPTYthis +#define thisBOOST_CONTRACT_EXT_PP_KEYWORD_THIS_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_THIS_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_THIS_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_THIS_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_THIS_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_THIS_FRONT`). +// Precondition: tokens must start with `this` (this can be +// checked with `..._IS_THIS_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_THIS_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_THIS_REMOVE) +// Precondition: tokens must end with `this` (this can be +// checked with `..._IS_THIS_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_THIS_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/thread_local.hpp b/include/boost/contract/ext_/preprocessor/keyword/thread_local.hpp index d5e4957..ca2f404 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/thread_local.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/thread_local.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_THREAD_LOCAL_ISxthread_local (1) -#define thread_localxBOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_REMOVExthread_local -#define thread_localxBOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_CAT_TO_COMMAthread_local , +#define thread_localBOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_CAT_TO_EMPTYthread_local +#define thread_localBOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_THREAD_LOCAL_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_THREAD_LOCAL_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_THREAD_LOCAL_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_THREAD_LOCAL_FRONT`). +// Precondition: tokens must start with `thread_local` (this can be +// checked with `..._IS_THREAD_LOCAL_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_THREAD_LOCAL_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_REMOVE) +// Precondition: tokens must end with `thread_local` (this can be +// checked with `..._IS_THREAD_LOCAL_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_THREAD_LOCAL_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/throw.hpp b/include/boost/contract/ext_/preprocessor/keyword/throw.hpp index bf651a4..a97f6ba 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/throw.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/throw.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_THROW_ISxthrow (1) -#define throwxBOOST_CONTRACT_EXT_PP_KEYWORD_THROW_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_REMOVExthrow -#define throwxBOOST_CONTRACT_EXT_PP_KEYWORD_THROW_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_CAT_TO_COMMAthrow , +#define throwBOOST_CONTRACT_EXT_PP_KEYWORD_THROW_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_CAT_TO_EMPTYthrow +#define throwBOOST_CONTRACT_EXT_PP_KEYWORD_THROW_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_THROW_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_THROW_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_THROW_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_THROW_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_THROW_FRONT`). +// Precondition: tokens must start with `throw` (this can be +// checked with `..._IS_THROW_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_THROW_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_THROW_REMOVE) +// Precondition: tokens must end with `throw` (this can be +// checked with `..._IS_THROW_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_THROW_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/true.hpp b/include/boost/contract/ext_/preprocessor/keyword/true.hpp index a2774ab..f3a3214 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/true.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/true.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_TRUE_ISxtrue (1) -#define truexBOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_REMOVExtrue -#define truexBOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_CAT_TO_COMMAtrue , +#define trueBOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_CAT_TO_EMPTYtrue +#define trueBOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TRUE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TRUE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TRUE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_TRUE_FRONT`). +// Precondition: tokens must start with `true` (this can be +// checked with `..._IS_TRUE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_TRUE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_REMOVE) +// Precondition: tokens must end with `true` (this can be +// checked with `..._IS_TRUE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_TRUE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/try.hpp b/include/boost/contract/ext_/preprocessor/keyword/try.hpp index ba8c19e..7c55cf6 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/try.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/try.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_TRY_ISxtry (1) -#define tryxBOOST_CONTRACT_EXT_PP_KEYWORD_TRY_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_REMOVExtry -#define tryxBOOST_CONTRACT_EXT_PP_KEYWORD_TRY_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_CAT_TO_COMMAtry , +#define tryBOOST_CONTRACT_EXT_PP_KEYWORD_TRY_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_CAT_TO_EMPTYtry +#define tryBOOST_CONTRACT_EXT_PP_KEYWORD_TRY_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TRY_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TRY_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_TRY_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TRY_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_TRY_FRONT`). +// Precondition: tokens must start with `try` (this can be +// checked with `..._IS_TRY_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_TRY_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_TRY_REMOVE) +// Precondition: tokens must end with `try` (this can be +// checked with `..._IS_TRY_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_TRY_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/typedef.hpp b/include/boost/contract/ext_/preprocessor/keyword/typedef.hpp index daf8a10..13f1d09 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/typedef.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/typedef.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_TYPEDEF_ISxtypedef (1) -#define typedefxBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_REMOVExtypedef -#define typedefxBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_CAT_TO_COMMAtypedef , +#define typedefBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_CAT_TO_EMPTYtypedef +#define typedefBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TYPEDEF_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TYPEDEF_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TYPEDEF_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_TYPEDEF_FRONT`). +// Precondition: tokens must start with `typedef` (this can be +// checked with `..._IS_TYPEDEF_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_TYPEDEF_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_REMOVE) +// Precondition: tokens must end with `typedef` (this can be +// checked with `..._IS_TYPEDEF_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEDEF_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/typeid.hpp b/include/boost/contract/ext_/preprocessor/keyword/typeid.hpp index 0f67c0f..531f822 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/typeid.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/typeid.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_TYPEID_ISxtypeid (1) -#define typeidxBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_REMOVExtypeid -#define typeidxBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_CAT_TO_COMMAtypeid , +#define typeidBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_CAT_TO_EMPTYtypeid +#define typeidBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TYPEID_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TYPEID_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TYPEID_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_TYPEID_FRONT`). +// Precondition: tokens must start with `typeid` (this can be +// checked with `..._IS_TYPEID_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_TYPEID_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_REMOVE) +// Precondition: tokens must end with `typeid` (this can be +// checked with `..._IS_TYPEID_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_TYPEID_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/typename.hpp b/include/boost/contract/ext_/preprocessor/keyword/typename.hpp index c5e1b90..9444420 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/typename.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/typename.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_TYPENAME_ISxtypename (1) -#define typenamexBOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_REMOVExtypename -#define typenamexBOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_CAT_TO_COMMAtypename , +#define typenameBOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_CAT_TO_EMPTYtypename +#define typenameBOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TYPENAME_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TYPENAME_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_TYPENAME_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_TYPENAME_FRONT`). +// Precondition: tokens must start with `typename` (this can be +// checked with `..._IS_TYPENAME_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_TYPENAME_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_REMOVE) +// Precondition: tokens must end with `typename` (this can be +// checked with `..._IS_TYPENAME_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_TYPENAME_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/union.hpp b/include/boost/contract/ext_/preprocessor/keyword/union.hpp index 56538dc..c7f11ac 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/union.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/union.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_UNION_ISxunion (1) -#define unionxBOOST_CONTRACT_EXT_PP_KEYWORD_UNION_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_REMOVExunion -#define unionxBOOST_CONTRACT_EXT_PP_KEYWORD_UNION_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_CAT_TO_COMMAunion , +#define unionBOOST_CONTRACT_EXT_PP_KEYWORD_UNION_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_CAT_TO_EMPTYunion +#define unionBOOST_CONTRACT_EXT_PP_KEYWORD_UNION_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_UNION_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_UNION_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_UNION_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_UNION_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_UNION_FRONT`). +// Precondition: tokens must start with `union` (this can be +// checked with `..._IS_UNION_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_UNION_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_UNION_REMOVE) +// Precondition: tokens must end with `union` (this can be +// checked with `..._IS_UNION_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_UNION_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/unsigned.hpp b/include/boost/contract/ext_/preprocessor/keyword/unsigned.hpp index 8c95721..c2838b8 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/unsigned.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/unsigned.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_UNSIGNED_ISxunsigned (1) -#define unsignedxBOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_REMOVExunsigned -#define unsignedxBOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_CAT_TO_COMMAunsigned , +#define unsignedBOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_CAT_TO_EMPTYunsigned +#define unsignedBOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_UNSIGNED_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_UNSIGNED_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_UNSIGNED_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_UNSIGNED_FRONT`). +// Precondition: tokens must start with `unsigned` (this can be +// checked with `..._IS_UNSIGNED_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_UNSIGNED_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_REMOVE) +// Precondition: tokens must end with `unsigned` (this can be +// checked with `..._IS_UNSIGNED_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_UNSIGNED_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/using.hpp b/include/boost/contract/ext_/preprocessor/keyword/using.hpp index 3a67705..bbda780 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/using.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/using.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_USING_ISxusing (1) -#define usingxBOOST_CONTRACT_EXT_PP_KEYWORD_USING_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_USING_REMOVExusing -#define usingxBOOST_CONTRACT_EXT_PP_KEYWORD_USING_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_USING_CAT_TO_COMMAusing , +#define usingBOOST_CONTRACT_EXT_PP_KEYWORD_USING_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_USING_CAT_TO_EMPTYusing +#define usingBOOST_CONTRACT_EXT_PP_KEYWORD_USING_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_USING_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_USING_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_USING_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_USING_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_USING_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_USING_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_USING_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_USING_FRONT`). +// Precondition: tokens must start with `using` (this can be +// checked with `..._IS_USING_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_USING_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_USING_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_USING_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_USING_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_USING_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_USING_REMOVE) +// Precondition: tokens must end with `using` (this can be +// checked with `..._IS_USING_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_USING_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_USING_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/utility/is.hpp b/include/boost/contract/ext_/preprocessor/keyword/utility/is.hpp index f27aea6..3b267eb 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/utility/is.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/utility/is.hpp @@ -6,33 +6,42 @@ #include #include #include +#include -// PRIVATE // +/* PRIVATE */ -#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_(a, b) \ - BOOST_CONTRACT_EXT_PP_HAS_PAREN(BOOST_PP_CAT(a, b)) +#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_1 0 +#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_2 1 + +#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_CHECK_(a, b) \ + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_, \ + BOOST_PP_VARIADIC_SIZE(BOOST_PP_CAT(a, b))) -// PUBLIC // +/* PUBLIC */ -// Precondition: A macro `` must be #defined -// to expand to unary (e.g., `(1)`). +// Precondition: A macro named `cat_to_comma_prefix ## token-to-check` must be +// #defined to expand to `,`. +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ - tokens, checking_prefix) \ + cat_to_comma_prefix, tokens) \ BOOST_PP_IIF(BOOST_CONTRACT_EXT_PP_HAS_PAREN(tokens), \ 0 BOOST_PP_TUPLE_EAT(2) \ , \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_ \ - )(checking_prefix, tokens) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_CHECK_ \ + )(cat_to_comma_prefix, tokens) -// Precondition: A macro `` 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`). +// Precondition: A macro named `token-to-check ## cat_to_comma_postfix` must be +// #defined to expand to `,`. +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ - token, checking_postfix) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_(token, checking_postfix) + cat_to_comma_postfix, tokens) \ + BOOST_PP_IIF(BOOST_CONTRACT_EXT_PP_HAS_PAREN(tokens), \ + 0 BOOST_PP_TUPLE_EAT(2) \ + , \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_CHECK_ \ + )(tokens, cat_to_comma_postfix) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/virtual.hpp b/include/boost/contract/ext_/preprocessor/keyword/virtual.hpp index 0435703..d63989e 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/virtual.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/virtual.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_VIRTUAL_ISxvirtual (1) -#define virtualxBOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_REMOVExvirtual -#define virtualxBOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_CAT_TO_COMMAvirtual , +#define virtualBOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_CAT_TO_EMPTYvirtual +#define virtualBOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VIRTUAL_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VIRTUAL_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VIRTUAL_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_VIRTUAL_FRONT`). +// Precondition: tokens must start with `virtual` (this can be +// checked with `..._IS_VIRTUAL_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_VIRTUAL_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_REMOVE) +// Precondition: tokens must end with `virtual` (this can be +// checked with `..._IS_VIRTUAL_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_VIRTUAL_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/void.hpp b/include/boost/contract/ext_/preprocessor/keyword/void.hpp index 4dabae2..e804e56 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/void.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/void.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_VOID_ISxvoid (1) -#define voidxBOOST_CONTRACT_EXT_PP_KEYWORD_VOID_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_REMOVExvoid -#define voidxBOOST_CONTRACT_EXT_PP_KEYWORD_VOID_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_CAT_TO_COMMAvoid , +#define voidBOOST_CONTRACT_EXT_PP_KEYWORD_VOID_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_CAT_TO_EMPTYvoid +#define voidBOOST_CONTRACT_EXT_PP_KEYWORD_VOID_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VOID_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VOID_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_VOID_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VOID_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_VOID_FRONT`). +// Precondition: tokens must start with `void` (this can be +// checked with `..._IS_VOID_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_VOID_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_VOID_REMOVE) +// Precondition: tokens must end with `void` (this can be +// checked with `..._IS_VOID_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_VOID_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/volatile.hpp b/include/boost/contract/ext_/preprocessor/keyword/volatile.hpp index a9c226a..bd62b35 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/volatile.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/volatile.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_VOLATILE_ISxvolatile (1) -#define volatilexBOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_REMOVExvolatile -#define volatilexBOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_CAT_TO_COMMAvolatile , +#define volatileBOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_CAT_TO_EMPTYvolatile +#define volatileBOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VOLATILE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VOLATILE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_VOLATILE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_VOLATILE_FRONT`). +// Precondition: tokens must start with `volatile` (this can be +// checked with `..._IS_VOLATILE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_VOLATILE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_REMOVE) +// Precondition: tokens must end with `volatile` (this can be +// checked with `..._IS_VOLATILE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_VOLATILE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/wchar_t.hpp b/include/boost/contract/ext_/preprocessor/keyword/wchar_t.hpp index cfc74cc..6a84ea0 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/wchar_t.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/wchar_t.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_WCHAR_T_ISxwchar_t (1) -#define wchar_txBOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_REMOVExwchar_t -#define wchar_txBOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_CAT_TO_COMMAwchar_t , +#define wchar_tBOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_CAT_TO_EMPTYwchar_t +#define wchar_tBOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_WCHAR_T_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_WCHAR_T_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_WCHAR_T_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_WCHAR_T_FRONT`). +// Precondition: tokens must start with `wchar_t` (this can be +// checked with `..._IS_WCHAR_T_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_WCHAR_T_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_REMOVE) +// Precondition: tokens must end with `wchar_t` (this can be +// checked with `..._IS_WCHAR_T_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_WCHAR_T_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/while.hpp b/include/boost/contract/ext_/preprocessor/keyword/while.hpp index b8242e5..ba8a361 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/while.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/while.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_WHILE_ISxwhile (1) -#define whilexBOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_REMOVExwhile -#define whilexBOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_CAT_TO_COMMAwhile , +#define whileBOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_CAT_TO_EMPTYwhile +#define whileBOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_WHILE_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_WHILE_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_WHILE_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_WHILE_FRONT`). +// Precondition: tokens must start with `while` (this can be +// checked with `..._IS_WHILE_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_WHILE_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_REMOVE) +// Precondition: tokens must end with `while` (this can be +// checked with `..._IS_WHILE_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_WHILE_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/xor.hpp b/include/boost/contract/ext_/preprocessor/keyword/xor.hpp index 7e33784..1330e54 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/xor.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/xor.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_XOR_ISxxor (1) -#define xorxBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_REMOVExxor -#define xorxBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_CAT_TO_COMMAxor , +#define xorBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_CAT_TO_EMPTYxor +#define xorBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_XOR_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_XOR_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_XOR_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_XOR_FRONT`). +// Precondition: tokens must start with `xor` (this can be +// checked with `..._IS_XOR_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_XOR_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_REMOVE) +// Precondition: tokens must end with `xor` (this can be +// checked with `..._IS_XOR_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_CAT_TO_EMPTY) #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/xor_eq.hpp b/include/boost/contract/ext_/preprocessor/keyword/xor_eq.hpp index d2f9bf5..74a64b9 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/xor_eq.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/xor_eq.hpp @@ -8,34 +8,38 @@ #include #include -// PRIVATE // +/* 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_XOR_EQ_ISxxor_eq (1) -#define xor_eqxBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_IS (1) -// The following macro must expand to nothing. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_REMOVExxor_eq -#define xor_eqxBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_REMOVE +// Must expand to a single comma `,` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_CAT_TO_COMMAxor_eq , +#define xor_eqBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_CAT_TO_COMMA , +// Must expand to empty `` (not local macros, do not #undefine). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_CAT_TO_EMPTYxor_eq +#define xor_eqBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_CAT_TO_EMPTY -// PUBLIC // +/* PUBLIC */ +// Precondition: tokens must start with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. #define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_XOR_EQ_FRONT(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ - BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_ISx) + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_CAT_TO_COMMA, tokens) -#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_XOR_EQ_BACK(token) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ - xBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_IS) +// Precondition: tokens must end with a token concatenable to a macro name +// (e.g., a literal or integral token) or with parenthesis. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_XOR_EQ_BACK(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_CAT_TO_COMMA, tokens) -// Precondition: tokens start with keyword to remove (see `..._IS_XOR_EQ_FRONT`). +// Precondition: tokens must start with `xor_eq` (this can be +// checked with `..._IS_XOR_EQ_FRONT` macro above). #define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_REMOVE_FRONT(tokens) \ - BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_REMOVEx, tokens) + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_CAT_TO_EMPTY, tokens) -// Precondition: token ends with keyword to remove (see `..._IS_XOR_EQ_BACK`). -#define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_REMOVE_BACK(token) \ - BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_REMOVE) +// Precondition: tokens must end with `xor_eq` (this can be +// checked with `..._IS_XOR_EQ_BACK` macro above). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_REMOVE_BACK(tokens) \ + BOOST_PP_CAT(tokens, BOOST_CONTRACT_EXT_PP_KEYWORD_XOR_EQ_CAT_TO_EMPTY) #endif // #include guard