From 350c0e59b1ceb60fe85977ab800c04a4b7109263 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Wed, 27 May 2015 19:15:45 -0400 Subject: [PATCH] Add ned macro --- .../preprocessor/seq/detail/is_empty.hpp | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 include/boost/preprocessor/seq/detail/is_empty.hpp diff --git a/include/boost/preprocessor/seq/detail/is_empty.hpp b/include/boost/preprocessor/seq/detail/is_empty.hpp new file mode 100644 index 0000000..864b7f3 --- /dev/null +++ b/include/boost/preprocessor/seq/detail/is_empty.hpp @@ -0,0 +1,35 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Edward Diener 2015. +# * 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_SEQ_DETAIL_IS_EMPTY_HPP +# define BOOST_PREPROCESSOR_SEQ_DETAIL_IS_EMPTY_HPP +# +# include +# include +# include +# include +# +/* A empty is one that is just BOOST_PP_SEQ_NIL, + but for out purposes here it is a seq which + does not start with a unary, ie '(anything)' */ +# +# define BOOST_PP_SEQ_DETAIL_IS_EMPTY(seq) \ + BOOST_PP_COMPL \ + ( \ + BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq) \ + ) \ +/**/ +# +# define BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq) \ + BOOST_PP_BOOL(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq (nil)))) \ +/**/ +# +# endif