forked from boostorg/preprocessor
Added OPT macro to determine whether C++20's __VA_OPT__ is supported or not. Updated the undocumented variadic IS_EMPTY to use the functionality of __VA_OPT__ if it exists to provide perfect functionality for testing for emptiness.
This commit is contained in:
30
include/boost/preprocessor/variadic/detail/opt.hpp
Normal file
30
include/boost/preprocessor/variadic/detail/opt.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2019. *
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See *
|
||||
# * accompanying file LICENSE_1_0.txt or copy at *
|
||||
# * http://www.boost.org/LICENSE_1_0.txt) *
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_VARIADIC_DETAIL_OPT_HPP
|
||||
# define BOOST_PREPROCESSOR_VARIADIC_DETAIL_OPT_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
#
|
||||
# if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L
|
||||
#
|
||||
# define BOOST_PP_VARIADIC_OPT_FUNCTION(...) \
|
||||
__VA_OPT__(0,) 0, 0, 1 \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_VARIADIC_OPT_ELEM0(e0, ...) BOOST_PP_VARIADIC_OPT_ELEM_0(e0,__VA_ARGS__)
|
||||
# define BOOST_PP_VARIADIC_OPT_ELEM2(e0, ...) BOOST_PP_VARIADIC_OPT_ELEM_2(e0,__VA_ARGS__)
|
||||
# define BOOST_PP_VARIADIC_OPT_ELEM_0(e0, ...) e0
|
||||
# define BOOST_PP_VARIADIC_OPT_ELEM_2(e0, e1, e2, ...) e2
|
||||
#
|
||||
# endif
|
||||
#
|
||||
# endif
|
Reference in New Issue
Block a user