is_empty.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // (C) Copyright Edward Diener 2011-2015
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. #if !defined(BOOST_VMD_DETAIL_IS_EMPTY_HPP)
  6. #define BOOST_VMD_DETAIL_IS_EMPTY_HPP
  7. #include <boost/preprocessor/punctuation/is_begin_parens.hpp>
  8. #if BOOST_VMD_MSVC
  9. # pragma warning(once:4002)
  10. #define BOOST_VMD_DETAIL_IS_EMPTY_IIF_0(t, b) b
  11. #define BOOST_VMD_DETAIL_IS_EMPTY_IIF_1(t, b) t
  12. #if BOOST_VMD_MSVC_V8
  13. #define BOOST_VMD_DETAIL_IS_EMPTY_PROCESS(param) \
  14. BOOST_PP_IS_BEGIN_PARENS \
  15. ( \
  16. BOOST_VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C param () \
  17. ) \
  18. /**/
  19. #else
  20. #define BOOST_VMD_DETAIL_IS_EMPTY_PROCESS(...) \
  21. BOOST_PP_IS_BEGIN_PARENS \
  22. ( \
  23. BOOST_VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C __VA_ARGS__ () \
  24. ) \
  25. /**/
  26. #endif
  27. #else
  28. #define BOOST_VMD_DETAIL_IS_EMPTY_IIF_0(t, ...) __VA_ARGS__
  29. #define BOOST_VMD_DETAIL_IS_EMPTY_IIF_1(t, ...) t
  30. #define BOOST_VMD_DETAIL_IS_EMPTY_PROCESS(...) \
  31. BOOST_PP_IS_BEGIN_PARENS \
  32. ( \
  33. BOOST_VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C __VA_ARGS__ () \
  34. ) \
  35. /**/
  36. #endif /* BOOST_VMD_MSVC */
  37. #define BOOST_VMD_DETAIL_IS_EMPTY_PRIMITIVE_CAT(a, b) a ## b
  38. #define BOOST_VMD_DETAIL_IS_EMPTY_IIF(bit) \
  39. BOOST_VMD_DETAIL_IS_EMPTY_PRIMITIVE_CAT(BOOST_VMD_DETAIL_IS_EMPTY_IIF_,bit) \
  40. /**/
  41. #define BOOST_VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C(...) ()
  42. #define BOOST_VMD_DETAIL_IS_EMPTY_GEN_ZERO(...) 0
  43. #endif /* BOOST_VMD_DETAIL_IS_EMPTY_HPP */