1 2 // Copyright (C) 2009-2012 Lorenzo Caminiti 3 // Distributed under the Boost Software License, Version 1.0 4 // (see accompanying file LICENSE_1_0.txt or a copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 // Home at http://www.boost.org/libs/local_function 7 8 #ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_HPP_ 9 #define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_HPP_ 10 11 #include <boost/preprocessor/control/expr_iif.hpp> 12 #include <boost/preprocessor/logical/compl.hpp> 13 14 // `is_front_macro(tokens)` is 1 if `tokens` start w/ `keyword` to add, else 0. 15 #define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT( \ 16 tokens, is_front_macro, keyword) \ 17 BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(is_front_macro(tokens)), keyword) tokens 18 19 // `is_back_macro(tokens)` is 1 if `tokens` end with `keyword` to add, else 0. 20 #define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK( \ 21 tokens, is_back_macro, keyword) \ 22 tokens BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(is_back_macro(tokens)), keyword) 23 24 #endif // #include guard 25 26