has_opt.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # /* **************************************************************************
  2. # * *
  3. # * (C) Copyright Edward Diener 2019. *
  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_VARIADIC_DETAIL_HAS_OPT_HPP
  13. # define BOOST_PREPROCESSOR_VARIADIC_DETAIL_HAS_OPT_HPP
  14. #
  15. # include <boost/preprocessor/config/config.hpp>
  16. #
  17. # if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L
  18. #
  19. # if BOOST_PP_VARIADICS_MSVC
  20. # include <boost/preprocessor/cat.hpp>
  21. # endif
  22. #
  23. # define BOOST_PP_VARIADIC_HAS_OPT_FUNCTION(...) \
  24. __VA_OPT__(,) , 1, 0 \
  25. /**/
  26. #
  27. # if BOOST_PP_VARIADICS_MSVC
  28. # define BOOST_PP_VARIADIC_HAS_OPT_ELEM0(e0, ...) BOOST_PP_CAT(BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0,__VA_ARGS__),)
  29. # define BOOST_PP_VARIADIC_HAS_OPT_ELEM2(e0, ...) BOOST_PP_CAT(BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0,__VA_ARGS__),)
  30. # else
  31. # define BOOST_PP_VARIADIC_HAS_OPT_ELEM0(e0, ...) BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0,__VA_ARGS__)
  32. # define BOOST_PP_VARIADIC_HAS_OPT_ELEM2(e0, ...) BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0,__VA_ARGS__)
  33. # endif
  34. # define BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0, ...) e0
  35. # define BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0, e1, e2, ...) e2
  36. #
  37. # endif
  38. #
  39. # endif