|
||||
File indexing completed on 2025-01-18 09:53:38
0001 0002 // (C) Copyright Edward Diener 2011-2015 0003 // Use, modification and distribution are subject to the Boost Software License, 0004 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 0005 // http://www.boost.org/LICENSE_1_0.txt). 0006 0007 #if !defined(BOOST_VMD_IS_EMPTY_ARRAY_HPP) 0008 #define BOOST_VMD_IS_EMPTY_ARRAY_HPP 0009 0010 #include <boost/vmd/detail/setup.hpp> 0011 0012 #if BOOST_PP_VARIADICS 0013 0014 #include <boost/preprocessor/control/iif.hpp> 0015 #include <boost/vmd/is_array.hpp> 0016 #include <boost/vmd/identity.hpp> 0017 #include <boost/vmd/detail/is_empty_array.hpp> 0018 0019 /* 0020 0021 The succeeding comments in this file are in doxygen format. 0022 0023 */ 0024 0025 /** \file 0026 */ 0027 0028 /** \def BOOST_VMD_IS_EMPTY_ARRAY(sequence) 0029 0030 \brief Tests whether a sequence is an empty Boost PP array. 0031 0032 An empty Boost PP array is a two element tuple where the first 0033 size element is 0 and the second element is a tuple with a single 0034 empty element, ie. '(0,())'. 0035 0036 sequence = a possible empty array 0037 0038 returns = 1 if the sequence is an empty Boost PP array, 0039 0 if it is not. 0040 0041 The macro will generate a preprocessing error if the sequence 0042 is in the form of an array but its first tuple element, instead 0043 of being a number, is a preprocessor token which VMD cannot parse, 0044 as in the example '(&0,())' which is a valid tuple but an invalid 0045 array. 0046 0047 */ 0048 0049 #define BOOST_VMD_IS_EMPTY_ARRAY(sequence) \ 0050 BOOST_VMD_IDENTITY_RESULT \ 0051 ( \ 0052 BOOST_PP_IIF \ 0053 ( \ 0054 BOOST_VMD_IS_ARRAY(sequence), \ 0055 BOOST_VMD_DETAIL_IS_EMPTY_ARRAY_SIZE, \ 0056 BOOST_VMD_IDENTITY(0) \ 0057 ) \ 0058 (sequence) \ 0059 ) \ 0060 /**/ 0061 0062 /** \def BOOST_VMD_IS_EMPTY_ARRAY_D(d,sequence) 0063 0064 \brief Tests whether a sequence is an empty Boost PP array. Re-entrant version. 0065 0066 An empty Boost PP array is a two element tuple where the first 0067 size element is 0 and the second element is a tuple with a single 0068 empty element, ie. '(0,())'. 0069 0070 d = The next available BOOST_PP_WHILE iteration. <br/> 0071 sequence = a possible empty array 0072 0073 returns = 1 if the sequence is an empty Boost PP array, 0074 0 if it is not. 0075 0076 The macro will generate a preprocessing error if the sequence 0077 is in the form of an array but its first tuple element, instead 0078 of being a number, is a preprocessor token which VMD cannot parse, 0079 as in the example '(&0,())' which is a valid tuple but an invalid 0080 array. 0081 0082 */ 0083 0084 #define BOOST_VMD_IS_EMPTY_ARRAY_D(d,sequence) \ 0085 BOOST_VMD_IDENTITY_RESULT \ 0086 ( \ 0087 BOOST_PP_IIF \ 0088 ( \ 0089 BOOST_VMD_IS_ARRAY_D(d,sequence), \ 0090 BOOST_VMD_DETAIL_IS_EMPTY_ARRAY_SIZE, \ 0091 BOOST_VMD_IDENTITY(0) \ 0092 ) \ 0093 (sequence) \ 0094 ) \ 0095 /**/ 0096 0097 #endif /* BOOST_PP_VARIADICS */ 0098 #endif /* BOOST_VMD_IS_EMPTY_ARRAY_HPP */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |