forked from boostorg/preprocessor
Fixes for empty tuple processing
This commit is contained in:
52
include/boost/preprocessor/array/detail/get_data.hpp
Normal file
52
include/boost/preprocessor/array/detail/get_data.hpp
Normal file
@ -0,0 +1,52 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014. *
|
||||
# * 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_ARRAY_DETAIL_GET_DATA_HPP
|
||||
# define BOOST_PREPROCESSOR_ARRAY_DETAIL_GET_DATA_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/tuple/rem.hpp>
|
||||
#
|
||||
# if BOOST_PP_VARIADICS && BOOST_PP_VARIADICS_MSVC && _MSC_VER != 1400
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/control/if.hpp>
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/facilities/is_1.hpp>
|
||||
#
|
||||
# /* BOOST_PP_ARRAY_DETAIL_GET_DATA */
|
||||
#
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_REM(...) BOOST_PP_CAT(__VA_ARGS__,)
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_TUPLE_REM(size) BOOST_PP_ARRAY_DETAIL_GET_DATA_REM
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_SINGLE(size, data) BOOST_PP_ARRAY_DETAIL_GET_DATA_TUPLE_REM(size) data
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY(size, data) BOOST_PP_TUPLE_REM(size) data
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_CHECK_ZERO(size, data) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
size, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_SINGLE \
|
||||
) \
|
||||
(size,data) \
|
||||
/**/
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA(size, data) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_IS_1(size), \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_SINGLE, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_CHECK_ZERO \
|
||||
) \
|
||||
(size,data) \
|
||||
/**/
|
||||
# else
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA(size, data) BOOST_PP_TUPLE_REM(size) data
|
||||
# endif /* BOOST_PP_VARIADICS && BOOST_PP_VARIADICS_MSVC && _MSC_VER != 1400 */
|
||||
#
|
||||
# endif /* BOOST_PREPROCESSOR_ARRAY_DETAIL_GET_DATA_HPP */
|
@ -1,6 +1,7 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Paul Mensonides 2002.
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * 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)
|
||||
@ -18,6 +19,7 @@
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
# include <boost/preprocessor/tuple/rem.hpp>
|
||||
# include <boost/preprocessor/array/detail/get_data.hpp>
|
||||
#
|
||||
# /* BOOST_PP_ARRAY_PUSH_BACK */
|
||||
#
|
||||
@ -28,6 +30,6 @@
|
||||
# define BOOST_PP_ARRAY_PUSH_BACK_D(array, elem) BOOST_PP_ARRAY_PUSH_BACK_I(BOOST_PP_ARRAY_SIZE(array), BOOST_PP_ARRAY_DATA(array), elem)
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_ARRAY_PUSH_BACK_I(size, data, elem) (BOOST_PP_INC(size), (BOOST_PP_TUPLE_REM(size) data BOOST_PP_COMMA_IF(size) elem))
|
||||
# define BOOST_PP_ARRAY_PUSH_BACK_I(size, data, elem) (BOOST_PP_INC(size), (BOOST_PP_ARRAY_DETAIL_GET_DATA(size,data) BOOST_PP_COMMA_IF(size) elem))
|
||||
#
|
||||
# endif
|
||||
|
@ -1,6 +1,7 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Paul Mensonides 2002.
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * 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)
|
||||
@ -18,6 +19,7 @@
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
# include <boost/preprocessor/tuple/rem.hpp>
|
||||
# include <boost/preprocessor/array/detail/get_data.hpp>
|
||||
#
|
||||
# /* BOOST_PP_ARRAY_PUSH_FRONT */
|
||||
#
|
||||
@ -28,6 +30,6 @@
|
||||
# define BOOST_PP_ARRAY_PUSH_FRONT_D(array, elem) BOOST_PP_ARRAY_PUSH_FRONT_I(BOOST_PP_ARRAY_SIZE(array), BOOST_PP_ARRAY_DATA(array), elem)
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_ARRAY_PUSH_FRONT_I(size, data, elem) (BOOST_PP_INC(size), (elem BOOST_PP_COMMA_IF(size) BOOST_PP_TUPLE_REM(size) data))
|
||||
# define BOOST_PP_ARRAY_PUSH_FRONT_I(size, data, elem) (BOOST_PP_INC(size), (elem BOOST_PP_COMMA_IF(size) BOOST_PP_ARRAY_DETAIL_GET_DATA(size,data)))
|
||||
#
|
||||
# endif
|
||||
|
Reference in New Issue
Block a user