diff options
Diffstat (limited to '3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility')
3 files changed, 134 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/add.hpp b/3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/add.hpp new file mode 100644 index 0000000..13f5699 --- /dev/null +++ b/3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/add.hpp @@ -0,0 +1,25 @@ + +// Copyright (C) 2009-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://www.boost.org/libs/local_function + +#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_HPP_ +#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_HPP_ + +#include <boost/preprocessor/control/expr_iif.hpp> +#include <boost/preprocessor/logical/compl.hpp> + +// `is_front_macro(tokens)` is 1 if `tokens` start w/ `keyword` to add, else 0. +#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT( \ + tokens, is_front_macro, keyword) \ + BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(is_front_macro(tokens)), keyword) tokens + +// `is_back_macro(tokens)` is 1 if `tokens` end with `keyword` to add, else 0. +#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK( \ + tokens, is_back_macro, keyword) \ + tokens BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(is_back_macro(tokens)), keyword) + +#endif // #include guard + diff --git a/3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/is.hpp b/3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/is.hpp new file mode 100644 index 0000000..a5a1151 --- /dev/null +++ b/3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/is.hpp @@ -0,0 +1,51 @@ + +// Copyright (C) 2009-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://www.boost.org/libs/local_function + +#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_HPP_ +#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_HPP_ + +// Boost.Preprocessor author P. Mensodines confirmed on an Boost email thread +// (subject ``check if a token is a keyword (was "BOOST_PP_IS_UNARY()")'') +// that it is OK to used `PP_IS_UNARY()` to check if tokens match predefined +// "keyword" as it is done by the macros below (even if `PP_IS_UNARY()` is +// technically only part of Boost.Preprocessor private API). +#include <boost/preprocessor/detail/is_unary.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/eat.hpp> + +// PRIVATE // + +#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_(a, b) \ + BOOST_PP_IS_UNARY(BOOST_PP_CAT(a, b)) + +// PUBLIC // + +// `checking_prefix ## tokens` expand to unary (e.g., `(1)`) iff `tokens` start +// with keyword to check. +#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT( \ + tokens, checking_prefix) \ + BOOST_PP_IIF(BOOST_PP_IS_UNARY(tokens), \ + /* on MSVC this check works even if tokens already unary but on */ \ + /* C++03 (including GCC) this check on non-unary tokens gives */ \ + /* a concatenation error -- so return false is tokens is not unary */ \ + 0 BOOST_PP_TUPLE_EAT(2) \ + , \ + BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_ \ + )(checking_prefix, tokens) + +// `token ## checking_postfix` expand to unary (e.g., `(1)`) iff `token` is the +// keyword to check. This check only works if `token` is a single token, it +// will always expand to 0 if token is multiple tokens (e.g., `const *this`). +// This check will expand to 0 with no error if `token` starts with a +// non-alphanumeric symbol (e.g., `*this`). +#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK( \ + token, checking_postfix) \ + BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_(token, checking_postfix) + +#endif // #include guard + diff --git a/3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/remove.hpp b/3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/remove.hpp new file mode 100644 index 0000000..e2d2daa --- /dev/null +++ b/3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/remove.hpp @@ -0,0 +1,58 @@ + +// Copyright (C) 2009-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://www.boost.org/libs/local_function + +#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_HPP_ +#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_HPP_ + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/eat.hpp> +#include <boost/preprocessor/config/config.hpp> +#include <boost/preprocessor/cat.hpp> + +// PRIVATE // + +// From PP_EXPAND (my own reentrant version). +#if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() && \ + ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC() +# define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_(x) \ + BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_I_(x) +#else +# define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_(x) \ + BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_OO_((x)) +# define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_OO_( \ + par) \ + BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_I_ ## par +#endif +#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_I_(x) x + +// PUBLIC // + +// `is_front_macro(tokens)` is 1 if `tokens` start with keyword to remove. +// `removing_prefix ## <keyword-to-remove>` must expand to nothing, else 0. +#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT( \ + tokens, is_front_macro, removing_prefix) \ + /* without EXPAND doesn't expand on MSVC */ \ + BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_( \ + BOOST_PP_IIF(is_front_macro(tokens), \ + BOOST_PP_CAT \ + , \ + tokens BOOST_PP_TUPLE_EAT(2) \ + )(removing_prefix, tokens) \ + ) + +// `is_back_macro(tokens)` is 1 iff `tokens` end with keyword to remove. +// `<keyword-to-remove> ## removing_postfix` must expand to nothing, else 0. +#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK( \ + tokens, is_back_macro, removing_prefix) \ + BOOST_PP_IIF(is_back_macro(tokens), \ + BOOST_PP_CAT \ + , \ + tokens BOOST_PP_TUPLE_EAT(2) \ + )(tokens, removing_postfix) + +#endif // #include guard + |