test_is_parens_empty.cxx 819 B

1234567891011121314151617181920212223242526272829303132333435
  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. #include <boost/vmd/is_parens_empty.hpp>
  6. #include <boost/detail/lightweight_test.hpp>
  7. int main()
  8. {
  9. #if BOOST_PP_VARIADICS
  10. #define DATA () * 4
  11. #define DATA2 4 * ()
  12. #define DATA3 (X)
  13. #define DATA4 ()
  14. #define DATA5 ( )
  15. BOOST_TEST(!BOOST_VMD_IS_PARENS_EMPTY(DATA));
  16. BOOST_TEST(!BOOST_VMD_IS_PARENS_EMPTY(DATA2));
  17. BOOST_TEST(!BOOST_VMD_IS_PARENS_EMPTY(DATA3));
  18. BOOST_TEST(BOOST_VMD_IS_PARENS_EMPTY(DATA4));
  19. BOOST_TEST(BOOST_VMD_IS_PARENS_EMPTY(DATA5));
  20. #else
  21. BOOST_ERROR("No variadic macro support");
  22. #endif
  23. return boost::report_errors();
  24. }