is_empty.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_DETAIL_IS_EMPTY_HPP
  13. #define BOOST_PREPROCESSOR_DETAIL_IS_EMPTY_HPP
  14. #include <boost/preprocessor/punctuation/is_begin_parens.hpp>
  15. #if BOOST_PP_VARIADICS_MSVC
  16. # pragma warning(once:4002)
  17. #define BOOST_PP_DETAIL_IS_EMPTY_IIF_0(t, b) b
  18. #define BOOST_PP_DETAIL_IS_EMPTY_IIF_1(t, b) t
  19. #else
  20. #define BOOST_PP_DETAIL_IS_EMPTY_IIF_0(t, ...) __VA_ARGS__
  21. #define BOOST_PP_DETAIL_IS_EMPTY_IIF_1(t, ...) t
  22. #endif
  23. #if BOOST_PP_VARIADICS_MSVC && _MSC_VER <= 1400
  24. #define BOOST_PP_DETAIL_IS_EMPTY_PROCESS(param) \
  25. BOOST_PP_IS_BEGIN_PARENS \
  26. ( \
  27. BOOST_PP_DETAIL_IS_EMPTY_NON_FUNCTION_C param () \
  28. ) \
  29. /**/
  30. #else
  31. #define BOOST_PP_DETAIL_IS_EMPTY_PROCESS(...) \
  32. BOOST_PP_IS_BEGIN_PARENS \
  33. ( \
  34. BOOST_PP_DETAIL_IS_EMPTY_NON_FUNCTION_C __VA_ARGS__ () \
  35. ) \
  36. /**/
  37. #endif
  38. #define BOOST_PP_DETAIL_IS_EMPTY_PRIMITIVE_CAT(a, b) a ## b
  39. #define BOOST_PP_DETAIL_IS_EMPTY_IIF(bit) BOOST_PP_DETAIL_IS_EMPTY_PRIMITIVE_CAT(BOOST_PP_DETAIL_IS_EMPTY_IIF_,bit)
  40. #define BOOST_PP_DETAIL_IS_EMPTY_NON_FUNCTION_C(...) ()
  41. #endif /* BOOST_PREPROCESSOR_DETAIL_IS_EMPTY_HPP */