Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/local_function/detail/preprocessor/keyword/facility/remove.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 
0002 // Copyright (C) 2009-2012 Lorenzo Caminiti
0003 // Distributed under the Boost Software License, Version 1.0
0004 // (see accompanying file LICENSE_1_0.txt or a copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 // Home at http://www.boost.org/libs/local_function
0007 
0008 #ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_HPP_
0009 #define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_HPP_
0010 
0011 #include <boost/preprocessor/control/iif.hpp>
0012 #include <boost/preprocessor/tuple/eat.hpp>
0013 #include <boost/preprocessor/config/config.hpp>
0014 #include <boost/preprocessor/cat.hpp>
0015 
0016 // PRIVATE //
0017 
0018 // From PP_EXPAND (my own reentrant version).
0019 #if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() && \
0020         ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
0021 #   define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_(x) \
0022         BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_I_(x)
0023 #else
0024 #   define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_(x) \
0025         BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_OO_((x))
0026 #   define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_OO_( \
0027             par) \
0028         BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_I_ ## par
0029 #endif
0030 #define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_I_(x) x
0031 
0032 // PUBLIC //
0033 
0034 // `is_front_macro(tokens)` is 1 if `tokens` start with keyword to remove.
0035 // `removing_prefix ## <keyword-to-remove>` must expand to nothing, else 0.
0036 #define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT( \
0037         tokens, is_front_macro, removing_prefix) \
0038     /* without EXPAND doesn't expand on MSVC */ \
0039     BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_( \
0040         BOOST_PP_IIF(is_front_macro(tokens), \
0041             BOOST_PP_CAT \
0042         , \
0043             tokens BOOST_PP_TUPLE_EAT(2) \
0044         )(removing_prefix, tokens) \
0045     )
0046 
0047 // `is_back_macro(tokens)` is 1 iff `tokens` end with keyword to remove.
0048 // `<keyword-to-remove> ## removing_postfix` must expand to nothing, else 0.
0049 #define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK( \
0050         tokens, is_back_macro, removing_prefix) \
0051     BOOST_PP_IIF(is_back_macro(tokens), \
0052         BOOST_PP_CAT \
0053     , \
0054         tokens BOOST_PP_TUPLE_EAT(2) \
0055     )(tokens, removing_postfix)
0056 
0057 #endif // #include guard
0058