diff --git a/include/boost/contract/ext_/preprocessor/keyword/contract/invariant.hpp b/include/boost/contract/ext_/preprocessor/keyword/contract/invariant.hpp new file mode 100644 index 0000000..7548d89 --- /dev/null +++ b/include/boost/contract/ext_/preprocessor/keyword/contract/invariant.hpp @@ -0,0 +1,41 @@ + +// WARNING: FILE AUTOMATICALLY GENERATED, DO NOT MODIFY IT! +// Instead, modify and run the related generation script "generate.py". + +#ifndef BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_HPP_ +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_HPP_ + +#include +#include + +// PRIVATE // + +// NOTE: These are not local macros, do NOT #undefine them ('x' used to avoid +// concatenating to reserved symbols). +// The following macro must expand to a unary token (e.g., `(1)`). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_ISxinvariant (1) +#define invariantxBOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_IS (1) +// The following macro must expand to nothing. +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVExinvariant +#define invariantxBOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVE + +// PUBLIC // + +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_INVARIANT_FRONT(tokens) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT(tokens, \ + BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_ISx) + +#define BOOST_CONTRACT_EXT_PP_KEYWORD_IS_INVARIANT_BACK(token) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK(token, \ + xBOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_IS) + +// Precondition: tokens start with keyword to remove (see `..._IS_INVARIANT_FRONT`). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVE_FRONT(tokens) \ + BOOST_PP_CAT(BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVEx, tokens) + +// Precondition: token ends with keyword to remove (see `..._IS_INVARIANT_BACK`). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVE_BACK(token) \ + BOOST_PP_CAT(token, xBOOST_CONTRACT_EXT_PP_KEYWORD_INVARIANT_REMOVE) + +#endif // #include guard + \ No newline at end of file diff --git a/include/boost/contract/ext_/preprocessor/keyword/utility/is.hpp b/include/boost/contract/ext_/preprocessor/keyword/utility/is.hpp index 7ad1dec..f27aea6 100644 --- a/include/boost/contract/ext_/preprocessor/keyword/utility/is.hpp +++ b/include/boost/contract/ext_/preprocessor/keyword/utility/is.hpp @@ -1,10 +1,4 @@ -// Copyright (C) 2008-2012 Lorenzo Caminiti -// Distributed under the Boost Software License, Version 1.0 -// (see accompanying file LICENSE_1_0.txt or a copy at -// http://www.boost.org/LICENSE_1_0.txt) -// Home at http://sourceforge.net/projects/contractpp - #ifndef BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_HPP_ #define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_HPP_ @@ -20,9 +14,9 @@ // PUBLIC // -// `checking_prefix ## tokens` expand to unary (e.g., `(1)`) iff `tokens` start -// with keyword to check. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS( \ +// Precondition: A macro `` must be #defined +// to expand to unary (e.g., `(1)`). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_FRONT( \ tokens, checking_prefix) \ BOOST_PP_IIF(BOOST_CONTRACT_EXT_PP_HAS_PAREN(tokens), \ 0 BOOST_PP_TUPLE_EAT(2) \ @@ -30,5 +24,15 @@ BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_ \ )(checking_prefix, tokens) +// Precondition: A macro `` must be #defined +// to expand to unary (e.g., `(1)`). +// WARNING: This check only works if `token` is a single token, it will always +// expand to 0 with no errors if token is multiple tokens +// (e.g., `const *this`). Also, this check will expand to 0 with no error if +// `token` starts with a non-alphanumeric symbol (e.g., `*this`). +#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_BACK( \ + token, checking_postfix) \ + BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_(token, checking_postfix) + #endif // #include guard diff --git a/include/boost/contract/ext_/preprocessor/keyword/utility/rem.hpp b/include/boost/contract/ext_/preprocessor/keyword/utility/rem.hpp deleted file mode 100644 index 0ea3867..0000000 --- a/include/boost/contract/ext_/preprocessor/keyword/utility/rem.hpp +++ /dev/null @@ -1,31 +0,0 @@ - -// Copyright (C) 2008-2012 Lorenzo Caminiti -// Distributed under the Boost Software License, Version 1.0 -// (see accompanying file LICENSE_1_0.txt or a copy at -// http://www.boost.org/LICENSE_1_0.txt) -// Home at http://sourceforge.net/projects/contractpp - -#ifndef BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REM_HPP_ -#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REM_HPP_ - -#include - -// PRIVATE // - -// Adapted from BOOST_PP_EXPAND. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REMOVE_EXPAND_I_(tokens) \ - tokens -#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REM_EXPAND_(tokens) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REMOVE_EXPAND_I_(tokens) - -// PUBLIC // - -// `removing_prefix ## ` must expand to nothing, else 0. -// Precondition: Tokens start with keyword to remove (see KEYWORD_UTILITY_IS). -// IMPLEMENTATION: Below without EXPAND doesn't expand on MSVC. -#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REM(tokens, removing_prefix) \ - BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_REM_EXPAND_( \ - BOOST_PP_CAT(removing_prefix, tokens)) - -#endif // #include guard - diff --git a/include/boost/contract/ext_/preprocessor/traits/aux_/func_index.hpp b/include/boost/contract/ext_/preprocessor/traits/func/aux_/index.hpp similarity index 100% rename from include/boost/contract/ext_/preprocessor/traits/aux_/func_index.hpp rename to include/boost/contract/ext_/preprocessor/traits/func/aux_/index.hpp diff --git a/include/boost/contract/ext_/preprocessor/traits/aux_/tparam_index.hpp b/include/boost/contract/ext_/preprocessor/traits/tparam/aux_/index.hpp similarity index 100% rename from include/boost/contract/ext_/preprocessor/traits/aux_/tparam_index.hpp rename to include/boost/contract/ext_/preprocessor/traits/tparam/aux_/index.hpp diff --git a/wave.cfg b/wave.cfg new file mode 100644 index 0000000..e657ea4 --- /dev/null +++ b/wave.cfg @@ -0,0 +1,11 @@ + +# NOTE: Some of the paths in this file may need to be changed for your system. + +-D_WIN32 + +-Sinclude +-S"C:\git\modular-boost.win" +-S"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" + +--variadics +