remove_parens.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # /* **************************************************************************
  2. # * *
  3. # * (C) Copyright Edward Diener 2014.
  4. # * Distributed under the Boost Software License, Version 1.0. (See
  5. # * accompanying file LICENSE_1_0.txt or copy at
  6. # * http://www.boost.org/LICENSE_1_0.txt)
  7. # * *
  8. # ************************************************************************** */
  9. #
  10. # /* See http://www.boost.org for most recent version. */
  11. #
  12. #ifndef BOOST_PREPROCESSOR_REMOVE_PARENS_HPP
  13. #define BOOST_PREPROCESSOR_REMOVE_PARENS_HPP
  14. #include <boost/preprocessor/config/config.hpp>
  15. #include <boost/preprocessor/control/iif.hpp>
  16. #include <boost/preprocessor/facilities/identity.hpp>
  17. #include <boost/preprocessor/punctuation/is_begin_parens.hpp>
  18. #include <boost/preprocessor/tuple/enum.hpp>
  19. #define BOOST_PP_REMOVE_PARENS(param) \
  20. BOOST_PP_IIF \
  21. ( \
  22. BOOST_PP_IS_BEGIN_PARENS(param), \
  23. BOOST_PP_REMOVE_PARENS_DO, \
  24. BOOST_PP_IDENTITY \
  25. ) \
  26. (param)() \
  27. /**/
  28. #define BOOST_PP_REMOVE_PARENS_DO(param) \
  29. BOOST_PP_IDENTITY(BOOST_PP_TUPLE_ENUM(param)) \
  30. /**/
  31. #endif /* BOOST_PREPROCESSOR_REMOVE_PARENS_HPP */