tuple_elem_bug_test.cxx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. # include <boost/preprocessor/cat.hpp>
  13. # include <boost/preprocessor/control/if.hpp>
  14. # include <boost/preprocessor/tuple.hpp>
  15. # include <libs/preprocessor/test/test.h>
  16. #define TN_GEN_ONE(p) (1)
  17. #define TN_GEN_ZERO(p) (0)
  18. #define TN_TEST_ONE_MORE(parameter,ens) \
  19. BOOST_PP_IF \
  20. ( \
  21. BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(1,0,ens),0), \
  22. TN_GEN_ONE, \
  23. TN_GEN_ZERO \
  24. ) \
  25. (parameter) \
  26. /**/
  27. #define TN_TEST_ONE(parameter,ens) \
  28. BOOST_PP_TUPLE_ELEM \
  29. ( \
  30. 1, \
  31. 0, \
  32. TN_TEST_ONE_MORE(parameter,ens) \
  33. ) \
  34. /**/
  35. BEGIN TN_TEST_ONE(A,(1)) == 1 END
  36. BEGIN TN_TEST_ONE(A,()) == 0 END