parens.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_PARENS_HPP)
  6. #define BOOST_VMD_DETAIL_PARENS_HPP
  7. #include <boost/preprocessor/control/iif.hpp>
  8. #include <boost/preprocessor/punctuation/is_begin_parens.hpp>
  9. #include <boost/preprocessor/variadic/elem.hpp>
  10. #include <boost/vmd/empty.hpp>
  11. #include <boost/vmd/detail/mods.hpp>
  12. #include <boost/vmd/detail/parens_split.hpp>
  13. #include <boost/vmd/detail/parens_common.hpp>
  14. #define BOOST_VMD_DETAIL_PARENS_PROCESS(vseq) \
  15. BOOST_PP_IIF \
  16. ( \
  17. BOOST_PP_IS_BEGIN_PARENS(vseq), \
  18. BOOST_VMD_DETAIL_BEGIN_PARENS, \
  19. BOOST_VMD_EMPTY \
  20. ) \
  21. (vseq) \
  22. /**/
  23. #define BOOST_VMD_DETAIL_PARENS(...) \
  24. BOOST_PP_IIF \
  25. ( \
  26. BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \
  27. ( \
  28. BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \
  29. ), \
  30. BOOST_VMD_DETAIL_PARENS_SPLIT, \
  31. BOOST_VMD_DETAIL_PARENS_PROCESS \
  32. ) \
  33. (BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \
  34. /**/
  35. #define BOOST_VMD_DETAIL_PARENS_D(d,...) \
  36. BOOST_PP_IIF \
  37. ( \
  38. BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \
  39. ( \
  40. BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \
  41. ), \
  42. BOOST_VMD_DETAIL_PARENS_SPLIT, \
  43. BOOST_VMD_DETAIL_PARENS_PROCESS \
  44. ) \
  45. (BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \
  46. /**/
  47. #endif /* BOOST_VMD_DETAIL_PARENS_HPP */