diff options
author | Remko Tronçon <git@el-tramo.be> | 2013-08-21 18:24:42 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2013-08-22 20:27:22 (GMT) |
commit | 099c4028d6b357fd1de7e2d6296628c1367bf30d (patch) | |
tree | 6a6c3133a328d19518993ccf7982c26b269050e2 /3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/remove.hpp | |
parent | 07e9627cc7556d34c6fa5bd25ac8f34cd975d6bb (diff) | |
download | swift-099c4028d6b357fd1de7e2d6296628c1367bf30d.zip swift-099c4028d6b357fd1de7e2d6296628c1367bf30d.tar.bz2 |
Add boost/scope_exit.
Change-Id: I6a38e842252aa24f456465d181ccf0aae763abb5
Diffstat (limited to '3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/remove.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/local_function/detail/preprocessor/keyword/facility/remove.hpp | 58 |
1 files changed, 58 insertions, 0 deletions
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 + |