1 2 // (C) Copyright Edward Diener 2011-2015 3 // Use, modification and distribution are subject to the Boost Software License, 4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt). 6 7 #if !defined(BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_HPP) 8 #define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_HPP 9 10 #include <boost/preprocessor/comparison/equal.hpp> 11 #include <boost/preprocessor/control/iif.hpp> 12 #include <boost/preprocessor/tuple/elem.hpp> 13 #include <boost/preprocessor/tuple/size.hpp> 14 #include <boost/vmd/identity.hpp> 15 #include <boost/vmd/is_empty.hpp> 16 #include <boost/vmd/is_tuple.hpp> 17 18 #define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_CEM(tuple) \ 19 BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,tuple)) \ 20 /**/ 21 22 #define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE(tuple) \ 23 BOOST_VMD_IDENTITY_RESULT \ 24 ( \ 25 BOOST_PP_IIF \ 26 ( \ 27 BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(tuple),1), \ 28 BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_CEM, \ 29 BOOST_VMD_IDENTITY(0) \ 30 ) \ 31 (tuple) \ 32 ) \ 33 /**/ 34 35 #define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE_D(d,tuple) \ 36 BOOST_VMD_IDENTITY_RESULT \ 37 ( \ 38 BOOST_PP_IIF \ 39 ( \ 40 BOOST_PP_EQUAL_D(d,BOOST_PP_TUPLE_SIZE(tuple),1), \ 41 BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_CEM, \ 42 BOOST_VMD_IDENTITY(0) \ 43 ) \ 44 (tuple) \ 45 ) \ 46 /**/ 47 48 #define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE(tuple) \ 49 BOOST_VMD_IDENTITY_RESULT \ 50 ( \ 51 BOOST_PP_IIF \ 52 ( \ 53 BOOST_VMD_IS_TUPLE(tuple), \ 54 BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE, \ 55 BOOST_VMD_IDENTITY(0) \ 56 ) \ 57 (tuple) \ 58 ) \ 59 /**/ 60 61 #define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_D(d,tuple) \ 62 BOOST_VMD_IDENTITY_RESULT \ 63 ( \ 64 BOOST_PP_IIF \ 65 ( \ 66 BOOST_VMD_IS_TUPLE(tuple), \ 67 BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE_D, \ 68 BOOST_VMD_IDENTITY(0) \ 69 ) \ 70 (d,tuple) \ 71 ) \ 72 /**/ 73 74 #endif /* BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_HPP */ 75