diff options
Diffstat (limited to 'boost/vmd')
152 files changed, 20649 insertions, 0 deletions
diff --git a/boost/vmd/array.hpp b/boost/vmd/array.hpp new file mode 100644 index 0000000000..c629b1c1b5 --- /dev/null +++ b/boost/vmd/array.hpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ARRAY_HPP) +#define BOOST_VMD_ARRAY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/array/to_seq.hpp> +#include <boost/vmd/array/to_tuple.hpp> + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ARRAY_HPP */ diff --git a/boost/vmd/array/to_seq.hpp b/boost/vmd/array/to_seq.hpp new file mode 100644 index 0000000000..e8d0aad2b5 --- /dev/null +++ b/boost/vmd/array/to_seq.hpp @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ARRAY_TO_SEQ_HPP) +#define BOOST_VMD_ARRAY_TO_SEQ_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/array/to_seq.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/is_empty_array.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ARRAY_TO_SEQ(array) + + \brief converts an array to a seq. + + array = array to be converted. + + If the array is an array of 0 elements it is converted to an empty seq. + Otherwise the array is converted to a seq with the same number of elements as the array. +*/ + +#define BOOST_VMD_ARRAY_TO_SEQ(array) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY_ARRAY(array), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_ARRAY_TO_SEQ \ + ) \ + (array) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ARRAY_TO_SEQ_HPP */ diff --git a/boost/vmd/array/to_tuple.hpp b/boost/vmd/array/to_tuple.hpp new file mode 100644 index 0000000000..a959a849cc --- /dev/null +++ b/boost/vmd/array/to_tuple.hpp @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ARRAY_TO_TUPLE_HPP) +#define BOOST_VMD_ARRAY_TO_TUPLE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/array/to_tuple.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/is_empty_array.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ARRAY_TO_TUPLE(array) + + \brief converts an array to a tuple. + + array = array to be converted. + + If the array is an array of 0 elements it is converted to an empty tuple. + Otherwise the array is converted to a tuple with the same number of elements as the array. +*/ + +#define BOOST_VMD_ARRAY_TO_TUPLE(array) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY_ARRAY(array), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_ARRAY_TO_TUPLE \ + ) \ + (array) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ARRAY_TO_TUPLE_HPP */ diff --git a/boost/vmd/assert.hpp b/boost/vmd/assert.hpp new file mode 100644 index 0000000000..974fd6d0a9 --- /dev/null +++ b/boost/vmd/assert.hpp @@ -0,0 +1,58 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ASSERT_HPP) +#define BOOST_VMD_ASSERT_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/assert.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ASSERT(...) + + \brief Conditionally causes an error to be generated. + + ... = variadic parameters, maximum of 2 will be considered. + Any variadic parameters beyond the maximum of 2 are just ignored. + + The first variadic parameter is: + + cond = A condition that determines whether an assertion occurs. Valid values range from 0 to BOOST_PP_LIMIT_MAG. + + The second variadic parameter (optional) is: + + errstr = An error string for generating a compiler error when using the VC++ compiler. + The VC++ compiler is incapable of producing a preprocessor error so when the 'cond' + is 0, a compiler error is generated by outputting C++ code in the form of: + + typedef char errstr[-1]; + + The errstr defaults to BOOST_VMD_ASSERT_ERROR if not supplied. + It is only relevant for VC++. + + returns = If cond expands to 0, this macro causes an error. Otherwise, it expands to nothing. + For all compilers other than Visual C++ the error is a preprocessing error. + For Visual C++ the error is caused by output invalid C++: this error could be + masked if the invalid output is ignored by a macro which invokes this macro. + +*/ +# define BOOST_VMD_ASSERT(...) \ + BOOST_VMD_DETAIL_ASSERT(__VA_ARGS__) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ASSERT_HPP */ diff --git a/boost/vmd/assert_is_array.hpp b/boost/vmd/assert_is_array.hpp new file mode 100644 index 0000000000..2bb7745983 --- /dev/null +++ b/boost/vmd/assert_is_array.hpp @@ -0,0 +1,113 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ASSERT_IS_ARRAY_HPP) +#define BOOST_VMD_ASSERT_IS_ARRAY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ASSERT_IS_ARRAY(sequence) + + \brief Asserts that the sequence is a Boost PP array. + + The macro checks that the sequence is a Boost PP array. + If it is not a Boost PP array, it forces a compiler error. + + The macro normally checks for a Boost PP array only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + sequence = a possible Boost PP array. + + returns = Normally the macro returns nothing. + + If the sequence is a Boost PP array, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP array the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP array. + +*/ + +/** \def BOOST_VMD_ASSERT_IS_ARRAY_D(d,sequence) + + \brief Asserts that the sequence is a Boost PP array. Re-entrant version. + + The macro checks that the sequence is a Boost PP array. + If it is not a Boost PP array, it forces a compiler error. + + The macro normally checks for a Boost PP array only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + d = The next available BOOST_PP_WHILE iteration. + sequence = a possible Boost PP sequence. + + returns = Normally the macro returns nothing. + + If the sequence is a Boost PP array, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP array the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP array. + +*/ + +#if !BOOST_VMD_ASSERT_DATA + +#define BOOST_VMD_ASSERT_IS_ARRAY(sequence) +#define BOOST_VMD_ASSERT_IS_ARRAY_D(d,sequence) + +#else + +#include <boost/vmd/is_array.hpp> +#include <boost/vmd/assert.hpp> + +#define BOOST_VMD_ASSERT_IS_ARRAY(sequence) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_ARRAY(sequence), \ + BOOST_VMD_IS_ARRAY_ASSERT_ERROR \ + ) \ +/**/ + +#define BOOST_VMD_ASSERT_IS_ARRAY_D(d,sequence) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_ARRAY_D(d,sequence), \ + BOOST_VMD_IS_ARRAY_ASSERT_ERROR \ + ) \ +/**/ + +#endif /* !BOOST_VMD_ASSERT_DATA */ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ASSERT_IS_ARRAY_HPP */ diff --git a/boost/vmd/assert_is_empty.hpp b/boost/vmd/assert_is_empty.hpp new file mode 100644 index 0000000000..712f67fac6 --- /dev/null +++ b/boost/vmd/assert_is_empty.hpp @@ -0,0 +1,105 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ASSERT_IS_EMPTY_HPP) +#define BOOST_VMD_ASSERT_IS_EMPTY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + +#include <boost/vmd/assert.hpp> +#include <boost/vmd/is_empty.hpp> + +#endif + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ASSERT_IS_EMPTY(...) + + \brief Asserts that the input is empty. + + The macro checks to see if the input is empty or not. + If it is not empty, it forces a compiler error. + + The macro is a variadic macro taking any input. + For the VC++8 compiler (VS2005) the macro takes a single parameter of input to check and not variadic data. + + The macro normally checks for emptiness only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + .... = variadic input, for VC++8 this must be a single parameter. + + returns = Normally the macro returns nothing. + + If the input is empty, nothing is output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the input is not empty the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the input is not empty. + + It is recommended to append BOOST_PP_EMPTY() to whatever input + is being tested in order to avoid possible warning messages + from some compilers about no parameters being passed to the macro + when the input is truly empty. + +*/ + +#if BOOST_VMD_MSVC_V8 + +#if !BOOST_VMD_ASSERT_DATA + +#define BOOST_VMD_ASSERT_IS_EMPTY(input) + +#else + +#define BOOST_VMD_ASSERT_IS_EMPTY(input) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_EMPTY(input), \ + BOOST_VMD_IS_EMPTY_ASSERT_ERROR \ + ) \ +/**/ + +#endif // !BOOST_VMD_ASSERT_DATA + +#else + +#if !BOOST_VMD_ASSERT_DATA + +#define BOOST_VMD_ASSERT_IS_EMPTY(...) + +#else + +#define BOOST_VMD_ASSERT_IS_EMPTY(...) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_EMPTY(__VA_ARGS__), \ + BOOST_VMD_IS_EMPTY_ASSERT_ERROR \ + ) \ +/**/ + +#endif // !BOOST_VMD_ASSERT_DATA + +#endif /* BOOST_VMD_MSVC_V8 */ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ASSERT_IS_EMPTY_HPP */ diff --git a/boost/vmd/assert_is_identifier.hpp b/boost/vmd/assert_is_identifier.hpp new file mode 100644 index 0000000000..88211375eb --- /dev/null +++ b/boost/vmd/assert_is_identifier.hpp @@ -0,0 +1,158 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ASSERT_IS_IDENTIFIER_HPP) +#define BOOST_VMD_ASSERT_IS_IDENTIFIER_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ASSERT_IS_IDENTIFIER(...) + + \brief Asserts that the sequence is an identifier. + + The macro checks that the sequence is an identifier. + If it is not an identifier, it forces a compiler error. + + The macro normally checks for an identifier only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + ... = variadic parameters + + The variadic parameters are: + + sequence = A sequence to test as an identifier. + ids (optional) = The data may take one of two forms: + it is either one or more single identifiers + or a single Boost PP tuple of identifiers. + + returns = Normally the macro returns nothing. + + If the sequence is an identifier, nothing is + output. If optional ids are specified, for the + sequence to be an identifier it must be an + identifier that matches one of the optional + ids. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not an identifier the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not an + identifier. + + Identifiers are registered in VMD with: + + #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. + + The identifier must be registered to be found. + + Identifiers are pre-detected in VMD with: + + #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. + + If you specify optional ids and have not specified the detection + of an optional id, that id will never match an identifier. + +*/ + +/** \def BOOST_VMD_ASSERT_IS_IDENTIFIER_D(d,...) + + \brief Asserts that the sequence is an identifier. Re-entrant version. + + The macro checks that the sequence is an identifier. + If it is not an identifier, it forces a compiler error. + + The macro normally checks for an identifier only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + d = The next available BOOST_PP_WHILE iteration. + ... = variadic parameters + + The variadic parameters are: + + sequence = A sequence to test as an identifier. + ids (optional) = The data may take one of two forms: + it is either one or more single identifiers + or a single Boost PP tuple of identifiers. + + returns = Normally the macro returns nothing. + + If the sequence is an identifier, nothing is + output. If optional ids are specified, for the + sequence to be an identifier it must be an + identifier that matches one of the optional + ids. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not an identifier the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not an + identifier. + + Identifiers are registered in VMD with: + + #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. + + The identifier must be registered to be found. + + Identifiers are pre-detected in VMD with: + + #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. + + If you specify optional ids and have not specified the detection + of an optional id, that id will never match an identifier. + +*/ + +#if !BOOST_VMD_ASSERT_DATA + +#define BOOST_VMD_ASSERT_IS_IDENTIFIER(...) +#define BOOST_VMD_ASSERT_IS_IDENTIFIER_D(d,...) + +#else + +#include <boost/vmd/assert.hpp> +#include <boost/vmd/is_identifier.hpp> + +#define BOOST_VMD_ASSERT_IS_IDENTIFIER(...) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_IDENTIFIER(__VA_ARGS__), \ + BOOST_VMD_IDENTIFIER_ASSERT_ERROR \ + ) \ +/**/ + +#define BOOST_VMD_ASSERT_IS_IDENTIFIER_D(d,...) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_IDENTIFIER_D(d,__VA_ARGS__), \ + BOOST_VMD_IDENTIFIER_ASSERT_ERROR \ + ) \ +/**/ + +#endif // !BOOST_VMD_ASSERT_DATA +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ASSERT_IS_IDENTIFIER_HPP */ diff --git a/boost/vmd/assert_is_list.hpp b/boost/vmd/assert_is_list.hpp new file mode 100644 index 0000000000..6c1b5eaa06 --- /dev/null +++ b/boost/vmd/assert_is_list.hpp @@ -0,0 +1,113 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ASSERT_IS_LIST_HPP) +#define BOOST_VMD_ASSERT_IS_LIST_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ASSERT_IS_LIST(sequence) + + \brief Asserts that the sequence is a Boost PP list. + + The macro checks that the sequence is a Boost PP list. + If it is not a Boost PP list, it forces a compiler error. + + The macro normally checks for a Boost PP list only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + sequence = a possible Boost PP list. + + returns = Normally the macro returns nothing. + + If the sequence is a Boost PP list, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP list the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the parameter is not a + Boost PP list. + +*/ + +/** \def BOOST_VMD_ASSERT_IS_LIST_D(d,sequence) + + \brief Asserts that the sequence is a Boost PP list. Re-entrant version. + + The macro checks that the sequence is a Boost PP list. + If it is not a Boost PP list, it forces a compiler error. + + The macro normally checks for a Boost PP list only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + d = The next available BOOST_PP_WHILE iteration. + sequence = a possible Boost PP list. + + returns = Normally the macro returns nothing. + + If the sequence is a Boost PP list, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP list the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the parameter is not a + Boost PP list. + +*/ + +#if !BOOST_VMD_ASSERT_DATA + +#define BOOST_VMD_ASSERT_IS_LIST(sequence) +#define BOOST_VMD_ASSERT_IS_LIST_D(d,sequence) + +#else + +#include <boost/vmd/assert.hpp> +#include <boost/vmd/is_list.hpp> + +#define BOOST_VMD_ASSERT_IS_LIST(sequence) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_LIST(sequence), \ + BOOST_VMD_ASSERT_IS_LIST_ERROR \ + ) \ +/**/ + +#define BOOST_VMD_ASSERT_IS_LIST_D(d,sequence) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_LIST_D(d,sequence), \ + BOOST_VMD_ASSERT_IS_LIST_ERROR \ + ) \ +/**/ + +#endif /* BOOST_VMD_ASSERT_DATA */ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ASSERT_IS_LIST_HPP */ diff --git a/boost/vmd/assert_is_number.hpp b/boost/vmd/assert_is_number.hpp new file mode 100644 index 0000000000..e4eb717d84 --- /dev/null +++ b/boost/vmd/assert_is_number.hpp @@ -0,0 +1,73 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ASSERT_IS_NUMBER_HPP) +#define BOOST_VMD_ASSERT_IS_NUMBER_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ASSERT_IS_NUMBER(sequence) + + \brief Asserts that the sequence is a number. + + The macro checks that the parameter is a number. + If it is not a number, it forces a compiler error. + + The macro normally checks for a number only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + sequence = a possible number. + + returns = Normally the macro returns nothing. + + If the sequence is a number, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a number the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + number. + +*/ + +#if !BOOST_VMD_ASSERT_DATA + +#define BOOST_VMD_ASSERT_IS_NUMBER(sequence) + +#else + +#include <boost/vmd/assert.hpp> +#include <boost/vmd/is_number.hpp> + +#define BOOST_VMD_ASSERT_IS_NUMBER(sequence) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_NUMBER(sequence), \ + BOOST_VMD_IS_NUMBER_ASSERT_ERROR \ + ) \ +/**/ + +#endif // !BOOST_VMD_ASSERT_DATA + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ASSERT_IS_NUMBER_HPP */ diff --git a/boost/vmd/assert_is_seq.hpp b/boost/vmd/assert_is_seq.hpp new file mode 100644 index 0000000000..ba1ce2bd3c --- /dev/null +++ b/boost/vmd/assert_is_seq.hpp @@ -0,0 +1,113 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ASSERT_IS_SEQ_HPP) +#define BOOST_VMD_ASSERT_IS_SEQ_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ASSERT_IS_SEQ(sequence) + + \brief Asserts that the sequence is a Boost PP seq. + + The macro checks that the sequence is a Boost PP seq. + If it is not a Boost PP seq, it forces a compiler error. + + The macro normally checks for a Boost PP seq only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + sequence = a possible Boost PP seq. + + returns = Normally the macro returns nothing. + + If the sequence is a Boost PP seq, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP seq the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP seq. + +*/ + +/** \def BOOST_VMD_ASSERT_IS_SEQ_D(d,sequence) + + \brief Asserts that the sequence is a Boost PP seq. Re-entrant version. + + The macro checks that the sequence is a Boost PP seq. + If it is not a Boost PP seq, it forces a compiler error. + + The macro normally checks for a Boost PP seq only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + d = The next available BOOST_PP_WHILE iteration. + sequence = a possible Boost PP seq. + + returns = Normally the macro returns nothing. + + If the sequence is a Boost PP seq, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP seq the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP seq. + +*/ + +#if !BOOST_VMD_ASSERT_DATA + +#define BOOST_VMD_ASSERT_IS_SEQ(sequence) +#define BOOST_VMD_ASSERT_IS_SEQ_D(d,sequence) + +#else + +#include <boost/vmd/assert.hpp> +#include <boost/vmd/is_seq.hpp> + +#define BOOST_VMD_ASSERT_IS_SEQ(sequence) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_SEQ(sequence), \ + BOOST_VMD_ASSERT_IS_SEQ_ERROR \ + ) \ +/**/ + +#define BOOST_VMD_ASSERT_IS_SEQ_D(d,sequence) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_SEQ_D(d,sequence), \ + BOOST_VMD_ASSERT_IS_SEQ_ERROR \ + ) \ +/**/ + +#endif /* BOOST_VMD_ASSERT_DATA */ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ASSERT_IS_SEQ_HPP */ diff --git a/boost/vmd/assert_is_tuple.hpp b/boost/vmd/assert_is_tuple.hpp new file mode 100644 index 0000000000..18a9f145db --- /dev/null +++ b/boost/vmd/assert_is_tuple.hpp @@ -0,0 +1,73 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ASSERT_IS_TUPLE_HPP) +#define BOOST_VMD_ASSERT_IS_TUPLE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ASSERT_IS_TUPLE(sequence) + + \brief Asserts that the sequence is a Boost PP tuple. + + The macro checks that the sequence is a Boost PP tuple. + If it is not a Boost PP tuple, it forces a compiler error. + + The macro normally checks for a Boost PP tuple only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + sequence = a possible Boost PP tuple. + + returns = Normally the macro returns nothing. + + If the sequence is a Boost PP tuple, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP tuple the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP tuple. + +*/ + +#if !BOOST_VMD_ASSERT_DATA + +#define BOOST_VMD_ASSERT_IS_TUPLE(sequence) + +#else + +#include <boost/vmd/assert.hpp> +#include <boost/vmd/is_tuple.hpp> + +#define BOOST_VMD_ASSERT_IS_TUPLE(sequence) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_TUPLE(sequence), \ + BOOST_VMD_ASSERT_IS_TUPLE_ERROR \ + ) \ +/**/ + +#endif /* BOOST_VMD_ASSERT_DATA */ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ASSERT_IS_TUPLE_HPP */ diff --git a/boost/vmd/assert_is_type.hpp b/boost/vmd/assert_is_type.hpp new file mode 100644 index 0000000000..5bf86d1cac --- /dev/null +++ b/boost/vmd/assert_is_type.hpp @@ -0,0 +1,113 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ASSERT_IS_TYPE_HPP) +#define BOOST_VMD_ASSERT_IS_TYPE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ASSERT_IS_TYPE(sequence) + + \brief Asserts that the sequence is a VMD type. + + The macro checks that the sequence is a VMD type. + If it is not a VMD type, it forces a compiler error. + + The macro normally checks for a VMD type only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + sequence = a possible VMD type. + + returns = Normally the macro returns nothing. + + If the sequence is a VMD type, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a VMD type the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + VMD type. + +*/ + +/** \def BOOST_VMD_ASSERT_IS_TYPE_D(d,sequence) + + \brief Asserts that the sequence is a VMD type. Re-entrant version. + + The macro checks that the sequence is a VMD type. + If it is not a VMD type, it forces a compiler error. + + The macro normally checks for a VMD type only in + debug mode. However an end-user can force the macro + to check or not check by defining the macro + BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. + + d = The next available BOOST_PP_WHILE iteration. + sequence = a possible VMD type. + + returns = Normally the macro returns nothing. + + If the sequence is a VMD type, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a VMD type the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + VMD type. + +*/ + +#if !BOOST_VMD_ASSERT_DATA + +#define BOOST_VMD_ASSERT_IS_TYPE(sequence) +#define BOOST_VMD_ASSERT_IS_TYPE_D(d,sequence) + +#else + +#include <boost/vmd/assert.hpp> +#include <boost/vmd/is_type.hpp> + +#define BOOST_VMD_ASSERT_IS_TYPE(sequence) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_TYPE(sequence), \ + BOOST_VMD_IS_TYPE_ASSERT_ERROR \ + ) \ +/**/ + +#define BOOST_VMD_ASSERT_IS_TYPE_D(d,sequence) \ + BOOST_VMD_ASSERT \ + ( \ + BOOST_VMD_IS_TYPE_D(d,sequence), \ + BOOST_VMD_IS_TYPE_ASSERT_ERROR \ + ) \ +/**/ + +#endif // !BOOST_VMD_ASSERT_DATA + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ASSERT_IS_TYPE_HPP */ diff --git a/boost/vmd/detail/adjust_tuple_type.hpp b/boost/vmd/detail/adjust_tuple_type.hpp new file mode 100644 index 0000000000..6523b1a6fa --- /dev/null +++ b/boost/vmd/detail/adjust_tuple_type.hpp @@ -0,0 +1,97 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_HPP) +#define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_HPP + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/detail/equal_type.hpp> +#include <boost/vmd/detail/is_array_common.hpp> +#include <boost/vmd/detail/is_list.hpp> +#include <boost/vmd/detail/type_registration.hpp> + +#define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_ARRAY(data,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX(data), \ + BOOST_VMD_TYPE_ARRAY, \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_ARRAY_D(d,data,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX_D(d,data), \ + BOOST_VMD_TYPE_ARRAY, \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_LIST(data,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_LIST_WLOOP(data), \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_LIST), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_ARRAY \ + ) \ + (data,type) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_LIST_D(d,data,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_LIST_WLOOP_D(d,data), \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_LIST), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_ARRAY_D \ + ) \ + (d,data,type) \ + ) \ +/**/ + +/* + + Input is any VMD data and a VMD type for that data + + If the type is a tuple, checks to see if it is a more specific + type and, if it is, returns that type, + otherwise returns the type passed as a parameter + +*/ + +#define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(data,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(BOOST_VMD_TYPE_TUPLE,type), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_LIST, \ + BOOST_VMD_IDENTITY(type) \ + ) \ + (data,type) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,data,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,BOOST_VMD_TYPE_TUPLE,type), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_LIST_D, \ + BOOST_VMD_IDENTITY(type) \ + ) \ + (d,data,type) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_HPP */ diff --git a/boost/vmd/detail/array.hpp b/boost/vmd/detail/array.hpp new file mode 100644 index 0000000000..cedc253d2b --- /dev/null +++ b/boost/vmd/detail/array.hpp @@ -0,0 +1,189 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_ARRAY_HPP) +#define BOOST_VMD_DETAIL_ARRAY_HPP + +#include <boost/preprocessor/control/expr_iif.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/empty_result.hpp> +#include <boost/vmd/detail/is_array_common.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/tuple.hpp> + +#define BOOST_VMD_DETAIL_ARRAY_CHECK_FOR_ARRAY(tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX \ + ( \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + tuple \ + ) \ + ), \ + BOOST_VMD_IDENTITY(tuple), \ + BOOST_VMD_DETAIL_EMPTY_RESULT \ + ) \ + (tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_CHECK_FOR_ARRAY_D(d,tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX_D \ + ( \ + d, \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + tuple \ + ) \ + ), \ + BOOST_VMD_IDENTITY(tuple), \ + BOOST_VMD_DETAIL_EMPTY_RESULT \ + ) \ + (tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_PROCESS(tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + tuple \ + ) \ + ), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_ARRAY_CHECK_FOR_ARRAY \ + ) \ + (tuple) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_PROCESS_D(d,tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + tuple \ + ) \ + ), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_ARRAY_CHECK_FOR_ARRAY_D \ + ) \ + (d,tuple) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_SPLIT(param) \ + BOOST_VMD_DETAIL_ARRAY_PROCESS \ + ( \ + BOOST_VMD_DETAIL_TUPLE(param,BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_SPLIT_D(d,param) \ + BOOST_VMD_DETAIL_ARRAY_PROCESS_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_TUPLE_D(d,param,BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_BEGIN_CHECK_FOR_ARRAY(tuple) \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX(tuple), \ + tuple \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_BEGIN_CHECK_FOR_ARRAY_D(d,tuple) \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX_D(d,tuple), \ + tuple \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_BEGIN_TUPLE(tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(tuple), \ + BOOST_VMD_EMPTY, \ + BOOST_VMD_DETAIL_ARRAY_BEGIN_CHECK_FOR_ARRAY \ + ) \ + (tuple) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_BEGIN_TUPLE_D(d,tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(tuple), \ + BOOST_VMD_EMPTY, \ + BOOST_VMD_DETAIL_ARRAY_BEGIN_CHECK_FOR_ARRAY_D \ + ) \ + (d,tuple) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_BEGIN(param) \ + BOOST_VMD_DETAIL_ARRAY_BEGIN_TUPLE \ + ( \ + BOOST_VMD_DETAIL_TUPLE(param) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_BEGIN_D(d,param) \ + BOOST_VMD_DETAIL_ARRAY_BEGIN_TUPLE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_TUPLE_D(d,param) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY(...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ), \ + BOOST_VMD_DETAIL_ARRAY_SPLIT, \ + BOOST_VMD_DETAIL_ARRAY_BEGIN \ + ) \ + (BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#define BOOST_VMD_DETAIL_ARRAY_D(d,...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ), \ + BOOST_VMD_DETAIL_ARRAY_SPLIT_D, \ + BOOST_VMD_DETAIL_ARRAY_BEGIN_D \ + ) \ + (d,BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_ARRAY_HPP */ diff --git a/boost/vmd/detail/assert.hpp b/boost/vmd/detail/assert.hpp new file mode 100644 index 0000000000..c772c720fd --- /dev/null +++ b/boost/vmd/detail/assert.hpp @@ -0,0 +1,69 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_ASSERT_HPP) +#define BOOST_VMD_DETAIL_ASSERT_HPP + +#include <boost/preprocessor/debug/assert.hpp> +#include <boost/preprocessor/variadic/elem.hpp> + +#if BOOST_VMD_MSVC + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/if.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/variadic/size.hpp> +#include <boost/vmd/empty.hpp> + +#define BOOST_VMD_DETAIL_ASSERT_VC_GEN_ERROR_OUTPUT(errstr) \ + BOOST_PP_ASSERT(0) \ + typedef char errstr[-1]; \ +/**/ + +#define BOOST_VMD_DETAIL_ASSERT_VC_GEN_ERROR_DEFAULT(...) \ + BOOST_VMD_DETAIL_ASSERT_VC_GEN_ERROR_OUTPUT(BOOST_VMD_ASSERT_ERROR) \ +/**/ + +#define BOOST_VMD_DETAIL_ASSERT_VC_GEN_ERROR_ERRSTR(...) \ + BOOST_VMD_DETAIL_ASSERT_VC_GEN_ERROR_OUTPUT(BOOST_PP_VARIADIC_ELEM(1,__VA_ARGS__)) \ +/**/ + +#define BOOST_VMD_DETAIL_ASSERT_TRUE(...) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL \ + ( \ + BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), \ + 1 \ + ), \ + BOOST_VMD_DETAIL_ASSERT_VC_GEN_ERROR_DEFAULT, \ + BOOST_VMD_DETAIL_ASSERT_VC_GEN_ERROR_ERRSTR \ + ) \ + (__VA_ARGS__) \ +/**/ + +#define BOOST_VMD_DETAIL_ASSERT(...) \ + BOOST_PP_IF \ + ( \ + BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__), \ + BOOST_VMD_EMPTY, \ + BOOST_VMD_DETAIL_ASSERT_TRUE \ + ) \ + (__VA_ARGS__) \ +/**/ + +#else + +#define BOOST_VMD_DETAIL_ASSERT_DO(cond) \ + BOOST_PP_ASSERT(cond) \ +/**/ + +#define BOOST_VMD_DETAIL_ASSERT(...) \ + BOOST_VMD_DETAIL_ASSERT_DO(BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#endif /* BOOST_VMD_MSVC */ +#endif /* BOOST_VMD_DETAIL_ASSERT_HPP */ diff --git a/boost/vmd/detail/data_equal.hpp b/boost/vmd/detail/data_equal.hpp new file mode 100644 index 0000000000..f7b07cb4dc --- /dev/null +++ b/boost/vmd/detail/data_equal.hpp @@ -0,0 +1,202 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_1.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_2.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_3.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_4.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_5.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_6.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_7.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_8.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_9.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_10.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_11.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_12.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_13.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_14.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_15.hpp> +#include <boost/vmd/detail/recurse/data_equal/data_equal_16.hpp> + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_HPP */ diff --git a/boost/vmd/detail/data_equal_common.hpp b/boost/vmd/detail/data_equal_common.hpp new file mode 100644 index 0000000000..edd8a4487b --- /dev/null +++ b/boost/vmd/detail/data_equal_common.hpp @@ -0,0 +1,409 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_COMMON_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_COMMON_HPP + +#include <boost/preprocessor/arithmetic/inc.hpp> +#include <boost/preprocessor/array/elem.hpp> +#include <boost/preprocessor/array/size.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/list/size.hpp> +#include <boost/preprocessor/logical/bitand.hpp> +#include <boost/preprocessor/logical/bitor.hpp> +#include <boost/preprocessor/logical/compl.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/pop_front.hpp> +#include <boost/preprocessor/tuple/push_back.hpp> +#include <boost/preprocessor/tuple/replace.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/get_type.hpp> +#include <boost/vmd/detail/equal_type.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(vseq1,vseq2) \ + BOOST_PP_BITAND \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(vseq1), \ + BOOST_PP_IS_BEGIN_PARENS(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_ELEM_ARRAY(d,index,data) \ + BOOST_PP_ARRAY_ELEM(index,data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_ELEM_LIST(d,index,data) \ + BOOST_PP_LIST_AT_D(d,data,index) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_ELEM_SEQ(d,index,data) \ + BOOST_PP_SEQ_ELEM(index,data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_ELEM_TUPLE(d,index,data) \ + BOOST_PP_TUPLE_ELEM(index,data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_ARRAY(data) \ + BOOST_PP_ARRAY_SIZE(data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_LIST(data) \ + BOOST_PP_LIST_SIZE(data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_SEQ(data) \ + BOOST_PP_SEQ_SIZE(data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_TUPLE(data) \ + BOOST_PP_TUPLE_SIZE(data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_ARRAY_D(d,data) \ + BOOST_PP_ARRAY_SIZE(data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_LIST_D(d,data) \ + BOOST_PP_LIST_SIZE_D(d,data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_SEQ_D(d,data) \ + BOOST_PP_SEQ_SIZE(data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_TUPLE_D(d,data) \ + BOOST_PP_TUPLE_SIZE(data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_ELEM(d,index,data,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_ELEM_ARRAY, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_ELEM_LIST, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_ELEM_SEQ, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_ELEM_TUPLE \ + ) \ + ) \ + ) \ + (d,index,data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(data,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_ARRAY, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_LIST, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_SEQ, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_TUPLE \ + ) \ + ) \ + ) \ + (data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,data,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_ARRAY_D, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_LIST_D, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_SEQ_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_TUPLE_D \ + ) \ + ) \ + ) \ + (d,data) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_RESULT(state) \ + BOOST_PP_TUPLE_ELEM(0,state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_FIRST(state) \ + BOOST_PP_TUPLE_ELEM(1,state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_SECOND(state) \ + BOOST_PP_TUPLE_ELEM(2,state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_SIZE(state) \ + BOOST_PP_TUPLE_ELEM(3,state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_TYPE(state) \ + BOOST_PP_TUPLE_ELEM(4,state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_INDEX(state) \ + BOOST_PP_TUPLE_ELEM(5,state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP(state) \ + BOOST_PP_TUPLE_ELEM(6,state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state) \ + BOOST_PP_BITAND \ + ( \ + BOOST_PP_EQUAL_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_INDEX(state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_SIZE(state) \ + ), \ + BOOST_PP_COMPL(BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_EMPTY(state)) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_EMPTY(state) \ + BOOST_VMD_IS_EMPTY(BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_INDEX(state) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_EMPTY(state), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_TUPLE_ELEM \ + ) \ + (0,BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_POP_NE_EMPTY(d,state) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + 6, \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_POP_NE_REMOVE(d,state) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + 6, \ + BOOST_PP_TUPLE_POP_FRONT(BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP(state)) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_POP(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,BOOST_PP_TUPLE_SIZE(BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP(state)),1), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_POP_NE_EMPTY, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_POP_NE_REMOVE \ + ) \ + (d,state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PUSH_CREATE(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_SUCCESS \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + 6, \ + (BOOST_VMD_DETAIL_DATA_EQUAL_STATE_INDEX(state)) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PUSH_ADD(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_SUCCESS \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + 6, \ + BOOST_PP_TUPLE_PUSH_BACK \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP(state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_INDEX(state) \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PUSH(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_EMPTY(state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PUSH_CREATE, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PUSH_ADD \ + ) \ + (d,state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_INDEX(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_INDEX, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_INDEX \ + ) \ + (state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_ELEM \ + ( \ + d, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_INDEX(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_FIRST(state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_TYPE(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_ELEM \ + ( \ + d, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_INDEX(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_SECOND(state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_TYPE(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_PRED(d,state) \ + BOOST_PP_BITAND \ + ( \ + BOOST_PP_EQUAL_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_RESULT(state), \ + 1 \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_NOT_EQUAL_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_INDEX(state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_SIZE(state) \ + ), \ + BOOST_PP_COMPL \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_EMPTY(state) \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP_SUCCESS_NCP(d,state) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + 5, \ + BOOST_PP_INC(BOOST_VMD_DETAIL_DATA_EQUAL_STATE_INDEX(state)) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP_SUCCESS(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_POP, \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_SUCCESS_NCP \ + ) \ + (d,state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP_FAILURE(d,state) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + 0, \ + 0 \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT(d,state,result) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,result,0), \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_FAILURE, \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,result,1), \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_SUCCESS, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PUSH \ + ) \ + ) \ + (d,state) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_TYPE(emf,ems,vtype) \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + BOOST_VMD_GET_TYPE(emf), \ + vtype \ + ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + BOOST_VMD_GET_TYPE(ems), \ + vtype \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_TYPE_D(d,emf,ems,vtype) \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + BOOST_VMD_GET_TYPE(emf), \ + vtype \ + ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + BOOST_VMD_GET_TYPE(ems), \ + vtype \ + ) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_COMMON_HPP */ diff --git a/boost/vmd/detail/empty_result.hpp b/boost/vmd/detail/empty_result.hpp new file mode 100644 index 0000000000..e393f58d8e --- /dev/null +++ b/boost/vmd/detail/empty_result.hpp @@ -0,0 +1,12 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EMPTY_RESULT_HPP) +#define BOOST_VMD_DETAIL_EMPTY_RESULT_HPP + +#define BOOST_VMD_DETAIL_EMPTY_RESULT(...) (,) + +#endif /* BOOST_VMD_DETAIL_EMPTY_RESULT_HPP */ diff --git a/boost/vmd/detail/equal.hpp b/boost/vmd/detail/equal.hpp new file mode 100644 index 0000000000..ab7e91ecab --- /dev/null +++ b/boost/vmd/detail/equal.hpp @@ -0,0 +1,562 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_HPP) +#define BOOST_VMD_DETAIL_EQUAL_HPP + +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/detail/auto_rec.hpp> +#include <boost/preprocessor/facilities/empty.hpp> +#include <boost/preprocessor/facilities/overload.hpp> +#include <boost/preprocessor/logical/compl.hpp> +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> +#include <boost/vmd/is_identifier.hpp> +#include <boost/vmd/is_empty_list.hpp> +#include <boost/vmd/detail/not_empty.hpp> + +#include <boost/vmd/detail/recurse/equal/equal_1.hpp> +#include <boost/vmd/detail/recurse/equal/equal_2.hpp> +#include <boost/vmd/detail/recurse/equal/equal_3.hpp> +#include <boost/vmd/detail/recurse/equal/equal_4.hpp> +#include <boost/vmd/detail/recurse/equal/equal_5.hpp> +#include <boost/vmd/detail/recurse/equal/equal_6.hpp> +#include <boost/vmd/detail/recurse/equal/equal_7.hpp> +#include <boost/vmd/detail/recurse/equal/equal_8.hpp> +#include <boost/vmd/detail/recurse/equal/equal_9.hpp> +#include <boost/vmd/detail/recurse/equal/equal_10.hpp> +#include <boost/vmd/detail/recurse/equal/equal_11.hpp> +#include <boost/vmd/detail/recurse/equal/equal_12.hpp> +#include <boost/vmd/detail/recurse/equal/equal_13.hpp> +#include <boost/vmd/detail/recurse/equal/equal_14.hpp> +#include <boost/vmd/detail/recurse/equal/equal_15.hpp> +#include <boost/vmd/detail/recurse/equal/equal_16.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_1(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_1_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_2(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_2_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_3(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_3_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_4(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_4_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_5(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_5_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_6(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_6_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_7(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_7_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_8(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_8_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_9(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_9_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_10(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_10_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_11(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_11_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_12(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_12_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_13(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_13_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_14(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_14_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_15(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_15_D(d,vseq1,vseq2) +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_16(d,vseq1,vseq2) BOOST_VMD_DETAIL_EQUAL_16_D(d,vseq1,vseq2) + +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_AUTO_REC_D(n) \ + BOOST_VMD_DETAIL_EQUAL_IS_1 \ + ( \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_ ## n(1,,) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D_, \ + BOOST_PP_AUTO_REC(BOOST_VMD_DETAIL_EQUAL_SIMPLE_AUTO_REC_D,16) \ + ) \ +/**/ + + +#define BOOST_VMD_DETAIL_EQUAL_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_TUPLE(vseq1,vtype1,type) \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + BOOST_VMD_TYPE_ARRAY, \ + vtype1 \ + ), \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + BOOST_VMD_TYPE_LIST, \ + vtype1 \ + ), \ + BOOST_PP_COMPL \ + ( \ + BOOST_VMD_IS_EMPTY_LIST(vseq1) \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_TUPLE_D(d,vseq1,vtype1,type) \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + BOOST_VMD_TYPE_ARRAY, \ + vtype1 \ + ), \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + BOOST_VMD_TYPE_LIST, \ + vtype1 \ + ), \ + BOOST_PP_COMPL \ + ( \ + BOOST_VMD_IS_EMPTY_LIST_D(d,vseq1) \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_IDENTIFIER(vseq1,vtype1,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + BOOST_VMD_TYPE_IDENTIFIER, \ + type \ + ), \ + BOOST_VMD_IS_IDENTIFIER, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_IDENTIFIER_D(d,vseq1,vtype1,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + BOOST_VMD_TYPE_IDENTIFIER, \ + type \ + ), \ + BOOST_VMD_IS_IDENTIFIER_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK(vseq1,vtype1,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + BOOST_VMD_TYPE_TUPLE, \ + type \ + ), \ + BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_TUPLE, \ + BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_IDENTIFIER \ + ) \ + (vseq1,vtype1,type) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_D(d,vseq1,vtype1,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + BOOST_VMD_TYPE_TUPLE, \ + type \ + ), \ + BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_TUPLE_D, \ + BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_IDENTIFIER_D \ + ) \ + (d,vseq1,vtype1,type) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE(vseq1,vtype1,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + type \ + ), \ + BOOST_VMD_IDENTITY(1), \ + BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK \ + ) \ + (vseq1,vtype1,type) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_D(d,vseq1,vtype1,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + type \ + ), \ + BOOST_VMD_IDENTITY(1), \ + BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_CHECK_D \ + ) \ + (d,vseq1,vtype1,type) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_WT_CHECK(vseq1,vseq2,vtype1,vtype2,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(type), \ + BOOST_VMD_DETAIL_EQUAL_TEST_TYPE, \ + BOOST_VMD_IDENTITY(1) \ + ) \ + (vseq1,vtype1,type) \ + ) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(type), \ + BOOST_VMD_DETAIL_EQUAL_TEST_TYPE_D, \ + BOOST_VMD_IDENTITY(1) \ + ) \ + (d,vseq1,vtype1,type) \ + ) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_WT_CONVERT(vseq1,vseq2,vtype1,vtype2,type) \ + BOOST_VMD_DETAIL_EQUAL_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2), \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2,type) \ + BOOST_VMD_DETAIL_EQUAL_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2), \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_WT(vseq1,vseq2,vtype1,vtype2,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2,type) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_WT_D(d,vseq1,vseq2,vtype1,vtype2,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2,type) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_GTYPE(vseq1,vseq2,type) \ + BOOST_VMD_DETAIL_EQUAL_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE), \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_GTYPE_D(d,vseq1,vseq2,type) \ + BOOST_VMD_DETAIL_EQUAL_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE), \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_EBP(vseq1,vseq2,be1,be2,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,type) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_EBP_D(d,vseq1,vseq2,be1,be2,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,type) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_EMPTY(vseq1,vseq2,be1,be2,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_EBP \ + ) \ + (vseq1,vseq2,be1,be2,type) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_EMPTY_D(d,vseq1,vseq2,be1,be2,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2,type) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_OV1(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2), \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_OV2(vseq1,vseq2,type) \ + BOOST_VMD_DETAIL_EQUAL_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2), \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_D_OV1(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2), \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_D_OV2(d,vseq1,vseq2,type) \ + BOOST_VMD_DETAIL_EQUAL_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2), \ + type \ + ) \ +/**/ + +#if BOOST_VMD_MSVC + +#define BOOST_VMD_DETAIL_EQUAL(vseq1,...) \ + BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_VMD_DETAIL_EQUAL_OV,__VA_ARGS__)(vseq1,__VA_ARGS__),BOOST_PP_EMPTY()) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_D(d,vseq1,...) \ + BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_VMD_DETAIL_EQUAL_D_OV,__VA_ARGS__)(d,vseq1,__VA_ARGS__),BOOST_PP_EMPTY()) \ +/**/ + +#else + +#define BOOST_VMD_DETAIL_EQUAL(vseq1,...) \ + BOOST_PP_OVERLOAD(BOOST_VMD_DETAIL_EQUAL_OV,__VA_ARGS__)(vseq1,__VA_ARGS__) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_D(d,vseq1,...) \ + BOOST_PP_OVERLOAD(BOOST_VMD_DETAIL_EQUAL_D_OV,__VA_ARGS__)(d,vseq1,__VA_ARGS__) \ +/**/ + +#endif + +#endif /* BOOST_VMD_DETAIL_EQUAL_HPP */ diff --git a/boost/vmd/detail/equal_common.hpp b/boost/vmd/detail/equal_common.hpp new file mode 100644 index 0000000000..776e099cf4 --- /dev/null +++ b/boost/vmd/detail/equal_common.hpp @@ -0,0 +1,153 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_COMMON_HPP) +#define BOOST_VMD_DETAIL_EQUAL_COMMON_HPP + +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/comparison/not_equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/logical/bitand.hpp> +#include <boost/preprocessor/logical/bitor.hpp> +#include <boost/preprocessor/logical/bitxor.hpp> +#include <boost/preprocessor/logical/compl.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/get_type.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/match_single_identifier.hpp> +#include <boost/vmd/detail/equal_type.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_CONCAT_1 (1) + +#define BOOST_VMD_DETAIL_EQUAL_IS_1(res) \ + BOOST_PP_IS_BEGIN_PARENS \ + ( \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CONCAT_, \ + res \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_MATCH_SINGLE_IDENTIFIER(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(vseq1,vseq2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_CNI_SMP(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_NUMBER), \ + BOOST_PP_EQUAL, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TYPE), \ + BOOST_VMD_DETAIL_EQUAL_TYPE, \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER \ + ) \ + ) \ + (vseq1,vseq2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_NUMBER), \ + BOOST_PP_EQUAL_D, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TYPE), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D, \ + BOOST_VMD_DETAIL_EQUAL_MATCH_SINGLE_IDENTIFIER \ + ) \ + ) \ + (d,vseq1,vseq2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_SIZE(vseq1,vseq2) \ + BOOST_PP_NOT_EQUAL \ + ( \ + BOOST_PP_TUPLE_SIZE(vseq1), \ + BOOST_PP_TUPLE_SIZE(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_SIZE_D(d,vseq1,vseq2) \ + BOOST_PP_NOT_EQUAL_D \ + ( \ + d, \ + BOOST_PP_TUPLE_SIZE(vseq1), \ + BOOST_PP_TUPLE_SIZE(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype1,BOOST_VMD_TYPE_TUPLE), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype2,BOOST_VMD_TYPE_TUPLE) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_SIZE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype1,BOOST_VMD_TYPE_TUPLE), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype2,BOOST_VMD_TYPE_TUPLE) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_SIZE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY(...) 1 + +#define BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(bp1,bp2) \ + BOOST_PP_COMPL \ + ( \ + BOOST_PP_BITXOR \ + ( \ + bp1, \ + bp2 \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(vseq1), \ + BOOST_PP_IS_BEGIN_PARENS(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_CHK_EMPTY_MATCH(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH \ + ( \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_COMMON_HPP */ diff --git a/boost/vmd/detail/equal_type.hpp b/boost/vmd/detail/equal_type.hpp new file mode 100644 index 0000000000..504fd00580 --- /dev/null +++ b/boost/vmd/detail/equal_type.hpp @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_TYPE_HPP) +#define BOOST_VMD_DETAIL_EQUAL_TYPE_HPP + +#include <boost/vmd/detail/match_single_identifier.hpp> +#include <boost/vmd/detail/type_registration.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_TYPE(type1,type2) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(type1,type2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,type1,type2) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(type1,type2) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_TYPE_HPP */ diff --git a/boost/vmd/detail/identifier.hpp b/boost/vmd/detail/identifier.hpp new file mode 100644 index 0000000000..9ebc705c54 --- /dev/null +++ b/boost/vmd/detail/identifier.hpp @@ -0,0 +1,429 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IDENTIFIER_HPP) +#define BOOST_VMD_DETAIL_IDENTIFIER_HPP + +#include <boost/preprocessor/arithmetic/dec.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/expr_iif.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/logical/bitand.hpp> +#include <boost/preprocessor/logical/bitor.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/identifier_concat.hpp> +#include <boost/vmd/detail/is_entire.hpp> +#include <boost/vmd/detail/match_identifier.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/not_empty.hpp> +#include <boost/vmd/detail/parens.hpp> + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_SUCCESS(id,rest,keymatch,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_SUCCESS_MODS(id,rest,BOOST_PP_DEC(keymatch),mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_FAILURE(id,rest,keymatch,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_MODS(mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_TUPLE_RESULT(id,rest,keymatch,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(keymatch,0), \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_FAILURE, \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_SUCCESS \ + ) \ + (id,rest,keymatch,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_TUPLE_RESULT_D(d,id,rest,keymatch,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,keymatch,0), \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_FAILURE, \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_SUCCESS \ + ) \ + (id,rest,keymatch,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_TUPLE(id,rest,keytuple,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_TUPLE_RESULT \ + ( \ + id, \ + rest, \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER(id,keytuple), \ + mods \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_TUPLE_D(d,id,rest,keytuple,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_TUPLE_RESULT_D \ + ( \ + d, \ + id, \ + rest, \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_D(d,id,keytuple), \ + mods \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_MAKE_SPLIT(tuple) \ + ( \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_TUPLE_ELEM(0,tuple) \ + ), \ + BOOST_PP_TUPLE_ELEM(1,tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_SPLIT_SEQUENCE_CONCAT_DATA(tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM(0,tuple) \ + ), \ + BOOST_VMD_IDENTITY(tuple), \ + BOOST_VMD_DETAIL_IDENTIFIER_MAKE_SPLIT \ + ) \ + (tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_SPLIT_SEQUENCE_CONCAT(vcseq) \ + BOOST_VMD_DETAIL_IDENTIFIER_SPLIT_SEQUENCE_CONCAT_DATA \ + ( \ + BOOST_VMD_DETAIL_PARENS(vcseq,BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_GETID_TID(tid) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(tid), \ + BOOST_VMD_IDENTITY(tid), \ + BOOST_PP_TUPLE_ELEM \ + ) \ + (0,tid) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_GETID_SEQUENCE(vseq) \ + BOOST_VMD_DETAIL_IDENTIFIER_GETID_TID \ + ( \ + BOOST_VMD_DETAIL_PARENS(BOOST_VMD_DETAIL_IDENTIFIER_CONCATENATE(vseq)) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_SPLIT_SEQUENCE(vseq) \ + BOOST_VMD_DETAIL_IDENTIFIER_SPLIT_SEQUENCE_CONCAT \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_CONCATENATE(vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS(id,rest,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_TUPLE \ + ( \ + id, \ + rest, \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(mods), \ + mods \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_D(d,id,rest,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_TUPLE_D \ + ( \ + d, \ + id, \ + rest, \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(mods), \ + mods \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_JUST(id,rest,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_SUCCESS_MODS(id,rest,0,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_JUST_D(d,id,rest,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_SUCCESS_MODS(id,rest,0,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_CHECK_KEYS(id,rest,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(mods) \ + ), \ + BOOST_VMD_DETAIL_IDENTIFIER_JUST, \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS \ + ) \ + (id,rest,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_CHECK_KEYS_D(d,id,rest,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(mods) \ + ), \ + BOOST_VMD_DETAIL_IDENTIFIER_JUST_D, \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_KEYS_D \ + ) \ + (d,id,rest,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_MKEYS(mods) \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_INDEX(mods), \ + BOOST_VMD_DETAIL_NOT_EMPTY \ + ( \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(mods) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_SUCCESS_MODS(id,rest,keymatch,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_MKEYS(mods), \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER(mods), \ + (id,rest,keymatch), \ + (id,keymatch) \ + ), \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER(mods), \ + (id,rest), \ + id \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_MODS(mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_MKEYS(mods), \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER(mods), \ + (,,), \ + (,) \ + ), \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER(mods), \ + (,) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_REST(id,rest,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_MODS(mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_REST_D(d,id,rest,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_MODS(mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_ID_REST(id,rest,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(id), \ + BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_REST, \ + BOOST_VMD_DETAIL_IDENTIFIER_CHECK_KEYS \ + ) \ + (id,rest,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_ID_REST_D(d,id,rest,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(id), \ + BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_REST_D, \ + BOOST_VMD_DETAIL_IDENTIFIER_CHECK_KEYS_D \ + ) \ + (d,id,rest,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_DATA(tuple,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_ID_REST \ + ( \ + BOOST_PP_TUPLE_ELEM(0,tuple), \ + BOOST_PP_TUPLE_ELEM(1,tuple), \ + mods \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_ID(id,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(id), \ + BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_REST, \ + BOOST_VMD_DETAIL_IDENTIFIER_CHECK_KEYS \ + ) \ + (id,,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_ID_D(d,id,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(id), \ + BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_REST_D, \ + BOOST_VMD_DETAIL_IDENTIFIER_CHECK_KEYS_D \ + ) \ + (d,id,,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_DATA_D(d,tuple,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_ID_REST_D \ + ( \ + d, \ + BOOST_PP_TUPLE_ELEM(0,tuple), \ + BOOST_PP_TUPLE_ELEM(1,tuple), \ + mods \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE_AFTER(vseq,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_DATA \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_SPLIT_SEQUENCE(vseq), \ + mods \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE_AFTER_D(d,vseq,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_DATA_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_IDENTIFIER_SPLIT_SEQUENCE(vseq), \ + mods \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE_ID(vseq,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_ID \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_GETID_SEQUENCE(vseq), \ + mods \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE_ID_D(d,vseq,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_PROCESS_ID_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_IDENTIFIER_GETID_SEQUENCE(vseq), \ + mods \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE(vseq,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER(mods), \ + BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE_AFTER, \ + BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE_ID \ + ) \ + (vseq,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE_D(d,vseq,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER(mods), \ + BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE_AFTER_D, \ + BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE_ID_D \ + ) \ + (d,vseq,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_EX_FAILURE(vseq,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_MODS(mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_EX_FAILURE_D(d,vseq,mods) \ + BOOST_VMD_DETAIL_IDENTIFIER_FAILURE_MODS(mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_EX(vseq,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_IS_EMPTY(vseq), \ + BOOST_PP_IS_BEGIN_PARENS(vseq) \ + ), \ + BOOST_VMD_DETAIL_IDENTIFIER_EX_FAILURE, \ + BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE \ + ) \ + (vseq,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_EX_D(d,vseq,mods) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_IS_EMPTY(vseq), \ + BOOST_PP_IS_BEGIN_PARENS(vseq) \ + ), \ + BOOST_VMD_DETAIL_IDENTIFIER_EX_FAILURE_D, \ + BOOST_VMD_DETAIL_IDENTIFIER_SEQUENCE_D \ + ) \ + (d,vseq,mods) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER(...) \ + BOOST_VMD_DETAIL_IDENTIFIER_EX \ + ( \ + BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__), \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_INDEX,__VA_ARGS__) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_D(d,...) \ + BOOST_VMD_DETAIL_IDENTIFIER_EX_D \ + ( \ + d, \ + BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__), \ + BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_INDEX,__VA_ARGS__) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_IDENTIFIER_MULTIPLE(...) \ + BOOST_VMD_DETAIL_IS_ENTIRE \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER(__VA_ARGS__,BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_IDENTIFIER_MULTIPLE_D(d,...) \ + BOOST_VMD_DETAIL_IS_ENTIRE \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_D(d,__VA_ARGS__,BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IDENTIFIER_HPP */ diff --git a/boost/vmd/detail/identifier_concat.hpp b/boost/vmd/detail/identifier_concat.hpp new file mode 100644 index 0000000000..6fa596db0c --- /dev/null +++ b/boost/vmd/detail/identifier_concat.hpp @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IDENTIFIER_CONCAT_HPP) +#define BOOST_VMD_DETAIL_IDENTIFIER_CONCAT_HPP + +#include <boost/preprocessor/cat.hpp> +#include <boost/vmd/detail/idprefix.hpp> + +#define BOOST_VMD_DETAIL_IDENTIFIER_CONCATENATE(vseq) \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_REGISTRATION_PREFIX, \ + vseq \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IDENTIFIER_CONCAT_HPP */ diff --git a/boost/vmd/detail/identifier_type.hpp b/boost/vmd/detail/identifier_type.hpp new file mode 100644 index 0000000000..ed7e4c1523 --- /dev/null +++ b/boost/vmd/detail/identifier_type.hpp @@ -0,0 +1,118 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IDENTIFIER_TYPE_HPP) +#define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_HPP + +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_tuple.hpp> +#include <boost/vmd/detail/idprefix.hpp> +#include <boost/vmd/detail/number_registration.hpp> +#include <boost/vmd/detail/type_registration.hpp> + +#define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCATENATE(id) \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_SUBTYPE_REGISTRATION_PREFIX, \ + id \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_SIZE(cres) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL \ + ( \ + BOOST_PP_TUPLE_SIZE(cres), \ + 2 \ + ), \ + BOOST_PP_TUPLE_ELEM, \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_IDENTIFIER) \ + ) \ + (0,cres) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_SIZE_D(d,cres) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D \ + ( \ + d, \ + BOOST_PP_TUPLE_SIZE(cres), \ + 2 \ + ), \ + BOOST_PP_TUPLE_ELEM, \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_IDENTIFIER) \ + ) \ + (0,cres) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCAT(cres) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(cres), \ + BOOST_VMD_DETAIL_IDENTIFIER_TYPE_SIZE, \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_IDENTIFIER) \ + ) \ + (cres) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCAT_D(d,cres) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(cres), \ + BOOST_VMD_DETAIL_IDENTIFIER_TYPE_SIZE_D, \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_IDENTIFIER) \ + ) \ + (d,cres) \ + ) \ +/**/ + +/* + + Determines the type of an identifier. + + The type may be that of an identifier or else + it may be a subtype. + + Assumes the 'id' is a valid identifier id + + Expands to the appropriate type + +*/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_TYPE(id) \ + BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCAT \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCATENATE(id) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_D(d,id) \ + BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCAT_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCATENATE(id) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IDENTIFIER_TYPE_HPP */ diff --git a/boost/vmd/detail/idprefix.hpp b/boost/vmd/detail/idprefix.hpp new file mode 100644 index 0000000000..e3b1ed6005 --- /dev/null +++ b/boost/vmd/detail/idprefix.hpp @@ -0,0 +1,14 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IDPREFIX_HPP) +#define BOOST_VMD_DETAIL_IDPREFIX_HPP + +#define BOOST_VMD_DETAIL_IDENTIFIER_DETECTION_PREFIX BOOST_VMD_DETECT_ +#define BOOST_VMD_DETAIL_IDENTIFIER_REGISTRATION_PREFIX BOOST_VMD_REGISTER_ +#define BOOST_VMD_DETAIL_IDENTIFIER_SUBTYPE_REGISTRATION_PREFIX BOOST_VMD_SUBTYPE_REGISTER_ + +#endif /* BOOST_VMD_DETAIL_IDPREFIX_HPP */ diff --git a/boost/vmd/detail/is_array.hpp b/boost/vmd/detail/is_array.hpp new file mode 100644 index 0000000000..83858640c8 --- /dev/null +++ b/boost/vmd/detail/is_array.hpp @@ -0,0 +1,41 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_ARRAY_HPP) +#define BOOST_VMD_DETAIL_IS_ARRAY_HPP + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_tuple.hpp> +#include <boost/vmd/detail/is_array_common.hpp> + +#define BOOST_VMD_DETAIL_IS_ARRAY(vseq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(vseq), \ + BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_D(d,vseq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(vseq), \ + BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IS_ARRAY_HPP */ diff --git a/boost/vmd/detail/is_array_common.hpp b/boost/vmd/detail/is_array_common.hpp new file mode 100644 index 0000000000..77914aa4c7 --- /dev/null +++ b/boost/vmd/detail/is_array_common.hpp @@ -0,0 +1,248 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_ARRAY_COMMON_HPP) +#define BOOST_VMD_DETAIL_IS_ARRAY_COMMON_HPP + +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/if.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/facilities/empty.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_number.hpp> +#include <boost/vmd/is_tuple.hpp> +#include <boost/vmd/detail/is_empty_tuple.hpp> + +#define BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX(tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(2,BOOST_PP_TUPLE_SIZE(tuple)), \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_ARRAY_FORM, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX_D(d,tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,2,BOOST_PP_TUPLE_SIZE(tuple)), \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_ARRAY_FORM_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,tuple) \ + ) \ +/**/ + +/* + + Check if the first element of the tuple is equal to the number of tuple elements of the second element + +*/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_SIZE(x) \ + BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(0,x),BOOST_PP_TUPLE_SIZE(BOOST_PP_TUPLE_ELEM(1,x))) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_SIZE_D(d,x) \ + BOOST_PP_EQUAL_D(d,BOOST_PP_TUPLE_ELEM(0,x),BOOST_PP_TUPLE_SIZE(BOOST_PP_TUPLE_ELEM(1,x))) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_EMPTY(tuple) \ + BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE(BOOST_PP_TUPLE_ELEM(1,tuple)) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_EMPTY_D(d,tuple) \ + BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE(BOOST_PP_TUPLE_ELEM(1,tuple)) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH(tuple) \ + BOOST_PP_IF \ + ( \ + BOOST_PP_TUPLE_ELEM(0,tuple), \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_SIZE, \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_EMPTY \ + ) \ + (tuple) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_D(d,tuple) \ + BOOST_PP_IF \ + ( \ + BOOST_PP_TUPLE_ELEM(0,tuple), \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_SIZE_D, \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_EMPTY_D \ + ) \ + (d,tuple) \ +/**/ + +/* + + Check if the first element is numeric + +*/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC(tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_ARRAY_NUM(BOOST_PP_TUPLE_ELEM(0,tuple)), \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_D(d,tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_ARRAY_NUM(BOOST_PP_TUPLE_ELEM(0,tuple)), \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMBER(tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_NUMBER(BOOST_PP_TUPLE_ELEM(0,tuple)), \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMBER_D(d,tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_NUMBER(BOOST_PP_TUPLE_ELEM(0,tuple)), \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,tuple) \ + ) \ +/**/ + +/* + + Check if the second element is a tuple + +*/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_ARRAY_FORM(tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(BOOST_PP_TUPLE_ELEM(1,tuple)), \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMBER, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_ARRAY_FORM_D(d,tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(BOOST_PP_TUPLE_ELEM(1,tuple)), \ + BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMBER_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM(x) BOOST_VMD_IS_EMPTY(BOOST_PP_CAT(BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_, x) BOOST_PP_EMPTY()) +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_0 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_1 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_2 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_3 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_4 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_5 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_6 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_7 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_8 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_9 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_10 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_11 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_12 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_13 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_14 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_15 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_16 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_17 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_18 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_19 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_20 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_21 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_22 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_23 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_24 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_25 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_26 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_27 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_28 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_29 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_30 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_31 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_32 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_33 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_34 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_35 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_36 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_37 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_38 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_39 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_40 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_41 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_42 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_43 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_44 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_45 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_46 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_47 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_48 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_49 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_50 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_51 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_52 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_53 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_54 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_55 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_56 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_57 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_58 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_59 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_60 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_61 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_62 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_63 +#define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_64 + +#endif /* BOOST_VMD_DETAIL_IS_ARRAY_COMMON_HPP */ diff --git a/boost/vmd/detail/is_empty.hpp b/boost/vmd/detail/is_empty.hpp new file mode 100644 index 0000000000..ddec5acb74 --- /dev/null +++ b/boost/vmd/detail/is_empty.hpp @@ -0,0 +1,61 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_EMPTY_HPP) +#define BOOST_VMD_DETAIL_IS_EMPTY_HPP + +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> + +#if BOOST_VMD_MSVC + +# pragma warning(once:4002) + +#define BOOST_VMD_DETAIL_IS_EMPTY_IIF_0(t, b) b +#define BOOST_VMD_DETAIL_IS_EMPTY_IIF_1(t, b) t + +#if BOOST_VMD_MSVC_V8 + +#define BOOST_VMD_DETAIL_IS_EMPTY_PROCESS(param) \ + BOOST_PP_IS_BEGIN_PARENS \ + ( \ + BOOST_VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C param () \ + ) \ +/**/ + +#else + +#define BOOST_VMD_DETAIL_IS_EMPTY_PROCESS(...) \ + BOOST_PP_IS_BEGIN_PARENS \ + ( \ + BOOST_VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C __VA_ARGS__ () \ + ) \ +/**/ + +#endif + +#else + +#define BOOST_VMD_DETAIL_IS_EMPTY_IIF_0(t, ...) __VA_ARGS__ +#define BOOST_VMD_DETAIL_IS_EMPTY_IIF_1(t, ...) t + +#define BOOST_VMD_DETAIL_IS_EMPTY_PROCESS(...) \ + BOOST_PP_IS_BEGIN_PARENS \ + ( \ + BOOST_VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C __VA_ARGS__ () \ + ) \ +/**/ + +#endif /* BOOST_VMD_MSVC */ + +#define BOOST_VMD_DETAIL_IS_EMPTY_PRIMITIVE_CAT(a, b) a ## b +#define BOOST_VMD_DETAIL_IS_EMPTY_IIF(bit) \ + BOOST_VMD_DETAIL_IS_EMPTY_PRIMITIVE_CAT(BOOST_VMD_DETAIL_IS_EMPTY_IIF_,bit) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C(...) () +#define BOOST_VMD_DETAIL_IS_EMPTY_GEN_ZERO(...) 0 + +#endif /* BOOST_VMD_DETAIL_IS_EMPTY_HPP */ diff --git a/boost/vmd/detail/is_empty_array.hpp b/boost/vmd/detail/is_empty_array.hpp new file mode 100644 index 0000000000..d9ff9fdef0 --- /dev/null +++ b/boost/vmd/detail/is_empty_array.hpp @@ -0,0 +1,20 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_EMPTY_ARRAY_HPP) +#define BOOST_VMD_DETAIL_IS_EMPTY_ARRAY_HPP + +#include <boost/preprocessor/array/size.hpp> +#include <boost/preprocessor/logical/not.hpp> + +#define BOOST_VMD_DETAIL_IS_EMPTY_ARRAY_SIZE(array) \ + BOOST_PP_NOT \ + ( \ + BOOST_PP_ARRAY_SIZE(array) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IS_EMPTY_ARRAY_HPP */ diff --git a/boost/vmd/detail/is_empty_tuple.hpp b/boost/vmd/detail/is_empty_tuple.hpp new file mode 100644 index 0000000000..dc07681653 --- /dev/null +++ b/boost/vmd/detail/is_empty_tuple.hpp @@ -0,0 +1,74 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_HPP) +#define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_HPP + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_tuple.hpp> + +#define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_CEM(tuple) \ + BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,tuple)) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE(tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(tuple),1), \ + BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_CEM, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE_D(d,tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,BOOST_PP_TUPLE_SIZE(tuple),1), \ + BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_CEM, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE(tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(tuple), \ + BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_D(d,tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(tuple), \ + BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,tuple) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_HPP */ diff --git a/boost/vmd/detail/is_entire.hpp b/boost/vmd/detail/is_entire.hpp new file mode 100644 index 0000000000..358e7d9e03 --- /dev/null +++ b/boost/vmd/detail/is_entire.hpp @@ -0,0 +1,23 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_ENTIRE_HPP) +#define BOOST_VMD_DETAIL_IS_ENTIRE_HPP + +#include <boost/preprocessor/logical/bitand.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/not_empty.hpp> + +#define BOOST_VMD_DETAIL_IS_ENTIRE(tuple) \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_PP_TUPLE_ELEM(0,tuple)), \ + BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,tuple)) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IS_ENTIRE_HPP */ diff --git a/boost/vmd/detail/is_identifier.hpp b/boost/vmd/detail/is_identifier.hpp new file mode 100644 index 0000000000..92dace090f --- /dev/null +++ b/boost/vmd/detail/is_identifier.hpp @@ -0,0 +1,96 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_IDENTIFIER_HPP) +#define BOOST_VMD_DETAIL_IS_IDENTIFIER_HPP + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/logical/bitor.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/variadic/size.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_tuple.hpp> +#include <boost/vmd/detail/identifier.hpp> +#include <boost/vmd/detail/identifier_concat.hpp> +#include <boost/vmd/detail/not_empty.hpp> + +#define BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_MATCH(tup) \ + BOOST_VMD_DETAIL_NOT_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM(0,tup) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_TUPLE(ptup) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(ptup), \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_MATCH, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (ptup) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_ID(vseq) \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_TUPLE \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_CONCATENATE(vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ(vseq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_IS_EMPTY(vseq), \ + BOOST_PP_IS_BEGIN_PARENS(vseq) \ + ), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_ID \ + ) \ + (vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE(...) \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ(BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE_D(d,...) \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ(BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_IDENTIFIER(...) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__),1), \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE, \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_MULTIPLE \ + ) \ + (__VA_ARGS__) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_IDENTIFIER_D(d,...) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,BOOST_PP_VARIADIC_SIZE(__VA_ARGS__),1), \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE_D, \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_MULTIPLE_D \ + ) \ + (d,__VA_ARGS__) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IS_IDENTIFIER_HPP */ diff --git a/boost/vmd/detail/is_list.hpp b/boost/vmd/detail/is_list.hpp new file mode 100644 index 0000000000..0a99499a85 --- /dev/null +++ b/boost/vmd/detail/is_list.hpp @@ -0,0 +1,207 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_LIST_HPP) +#define BOOST_VMD_DETAIL_IS_LIST_HPP + +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/control/while.hpp> +#include <boost/preprocessor/debug/assert.hpp> +#include <boost/preprocessor/facilities/empty.hpp> +#include <boost/preprocessor/logical/bitor.hpp> +#include <boost/preprocessor/logical/compl.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/preprocessor/variadic/size.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_identifier.hpp> +#include <boost/vmd/is_tuple.hpp> +#include <boost/vmd/detail/nil_registration.hpp> + +#define BOOST_VMD_DETAIL_IS_LIST_PROCESS_TUPLE(d,x) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(x), \ + BOOST_VMD_DETAIL_IS_LIST_PROCESS_TUPLE_SIZE, \ + BOOST_VMD_DETAIL_IS_LIST_ASSERT \ + ) \ + (d,x) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_PROCESS_TUPLE_SIZE(d,x) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,2,BOOST_PP_TUPLE_SIZE(x)), \ + BOOST_VMD_DETAIL_IS_LIST_RETURN_SECOND, \ + BOOST_VMD_DETAIL_IS_LIST_ASSERT \ + ) \ + (x) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_PRED(d,state) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(state), \ + BOOST_VMD_IDENTITY(1), \ + BOOST_VMD_DETAIL_IS_LIST_NOT_BOOST_PP_NIL \ + ) \ + (state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_OP(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(state), \ + BOOST_VMD_DETAIL_IS_LIST_PROCESS_TUPLE, \ + BOOST_VMD_DETAIL_IS_LIST_PROCESS_IF_BOOST_PP_NIL \ + ) \ + (d,state) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_PROCESS_IF_BOOST_PP_NIL(d,x) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_LIST_BOOST_PP_NIL(x), \ + BOOST_PP_NIL, \ + BOOST_VMD_IS_LIST_FAILURE \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_ASSERT(...) \ + BOOST_VMD_IS_LIST_FAILURE \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_NOT_BOOST_PP_NIL(x) \ + BOOST_PP_COMPL \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_IS_LIST_BOOST_PP_NIL(x), \ + BOOST_VMD_DETAIL_IS_LIST_IS_FAILURE(x) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_BOOST_PP_NIL(x) \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_DETAIL_IS_LIST_NIL_HELPER_, \ + x \ + ) BOOST_PP_EMPTY() \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_NIL_HELPER_BOOST_PP_NIL + +#define BOOST_VMD_DETAIL_IS_LIST_IS_FAILURE(x) \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_CAT(BOOST_VMD_DETAIL_IS_LIST_FHELPER_,x) BOOST_PP_EMPTY() \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_FHELPER_BOOST_VMD_IS_LIST_FAILURE + +#define BOOST_VMD_DETAIL_IS_LIST_RETURN_SECOND(x) \ + BOOST_PP_TUPLE_ELEM(1,x) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_RESULT(x) \ + BOOST_PP_COMPL \ + ( \ + BOOST_VMD_DETAIL_IS_LIST_IS_FAILURE(x) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_WLOOP(list) \ + BOOST_VMD_DETAIL_IS_LIST_RESULT \ + ( \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_IS_LIST_PRED, \ + BOOST_VMD_DETAIL_IS_LIST_OP, \ + list \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_WLOOP_D(d,list) \ + BOOST_VMD_DETAIL_IS_LIST_RESULT \ + ( \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_IS_LIST_PRED, \ + BOOST_VMD_DETAIL_IS_LIST_OP, \ + list \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_IS_EMPTY_LIST_PROCESS(list) \ + BOOST_VMD_IS_IDENTIFIER(list,BOOST_PP_NIL) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_IS_EMPTY_LIST_PROCESS_D(d,list) \ + BOOST_VMD_IS_IDENTIFIER_D(d,list,BOOST_PP_NIL) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_PROCESS(param) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(param), \ + BOOST_VMD_DETAIL_IS_LIST_WLOOP, \ + BOOST_VMD_DETAIL_IS_LIST_IS_EMPTY_LIST_PROCESS \ + ) \ + (param) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST(param) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(param), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_IS_LIST_PROCESS \ + ) \ + (param) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_PROCESS_D(d,param) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(param), \ + BOOST_VMD_DETAIL_IS_LIST_WLOOP_D, \ + BOOST_VMD_DETAIL_IS_LIST_IS_EMPTY_LIST_PROCESS_D \ + ) \ + (d,param) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_LIST_D(d,param) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(param), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_IS_LIST_PROCESS_D \ + ) \ + (d,param) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IS_LIST_HPP */ diff --git a/boost/vmd/detail/is_number.hpp b/boost/vmd/detail/is_number.hpp new file mode 100644 index 0000000000..b4a1d81cd8 --- /dev/null +++ b/boost/vmd/detail/is_number.hpp @@ -0,0 +1,38 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_NUMBER_HPP) +#define BOOST_VMD_DETAIL_IS_NUMBER_HPP + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/detail/equal_type.hpp> +#include <boost/vmd/detail/identifier_type.hpp> +#include <boost/vmd/detail/is_identifier.hpp> +#include <boost/vmd/detail/number_registration.hpp> + +#define BOOST_VMD_DETAIL_IS_NUMBER_TYPE(vseq) \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + BOOST_VMD_TYPE_NUMBER, \ + BOOST_VMD_DETAIL_IDENTIFIER_TYPE(vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_NUMBER(vseq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE(vseq), \ + BOOST_VMD_DETAIL_IS_NUMBER_TYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IS_NUMBER_HPP */ diff --git a/boost/vmd/detail/is_seq.hpp b/boost/vmd/detail/is_seq.hpp new file mode 100644 index 0000000000..d8c46bffea --- /dev/null +++ b/boost/vmd/detail/is_seq.hpp @@ -0,0 +1,27 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_SEQ_HPP) +#define BOOST_VMD_DETAIL_IS_SEQ_HPP + +#include <boost/vmd/detail/is_entire.hpp> +#include <boost/vmd/detail/seq.hpp> + +#define BOOST_VMD_DETAIL_IS_SEQ(seq) \ + BOOST_VMD_DETAIL_IS_ENTIRE \ + ( \ + BOOST_VMD_DETAIL_SEQ_SPLIT(seq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_SEQ_D(d,seq) \ + BOOST_VMD_DETAIL_IS_ENTIRE \ + ( \ + BOOST_VMD_DETAIL_SEQ_SPLIT_D(d,seq) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IS_SEQ_HPP */ diff --git a/boost/vmd/detail/is_tuple.hpp b/boost/vmd/detail/is_tuple.hpp new file mode 100644 index 0000000000..98bf8ecacb --- /dev/null +++ b/boost/vmd/detail/is_tuple.hpp @@ -0,0 +1,20 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_TUPLE_HPP) +#define BOOST_VMD_DETAIL_IS_TUPLE_HPP + +#include <boost/vmd/detail/is_entire.hpp> +#include <boost/vmd/detail/parens_split.hpp> + +#define BOOST_VMD_DETAIL_IS_TUPLE(vseq) \ + BOOST_VMD_DETAIL_IS_ENTIRE \ + ( \ + BOOST_VMD_DETAIL_PARENS_SPLIT(vseq) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IS_TUPLE_HPP */ diff --git a/boost/vmd/detail/is_type.hpp b/boost/vmd/detail/is_type.hpp new file mode 100644 index 0000000000..067f684e8b --- /dev/null +++ b/boost/vmd/detail/is_type.hpp @@ -0,0 +1,57 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_TYPE_HPP) +#define BOOST_VMD_DETAIL_IS_TYPE_HPP + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/detail/identifier_type.hpp> +#include <boost/vmd/detail/is_type_type.hpp> +#include <boost/vmd/detail/is_identifier.hpp> +#include <boost/vmd/detail/type_registration.hpp> + +#define BOOST_VMD_DETAIL_IS_TYPE_IMP_TYPE(vseq) \ + BOOST_VMD_DETAIL_IS_TYPE_TYPE \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_TYPE(vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_TYPE_IMP_TYPE_D(d,vseq) \ + BOOST_VMD_DETAIL_IS_TYPE_TYPE \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_TYPE_D(d,vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_TYPE(vseq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE(vseq), \ + BOOST_VMD_DETAIL_IS_TYPE_IMP_TYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_TYPE_D(d,vseq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE_D(d,vseq), \ + BOOST_VMD_DETAIL_IS_TYPE_IMP_TYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IS_TYPE_HPP */ diff --git a/boost/vmd/detail/is_type_type.hpp b/boost/vmd/detail/is_type_type.hpp new file mode 100644 index 0000000000..0b8ed6cce0 --- /dev/null +++ b/boost/vmd/detail/is_type_type.hpp @@ -0,0 +1,25 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_TYPE_TYPE_HPP) +#define BOOST_VMD_DETAIL_IS_TYPE_TYPE_HPP + +#include <boost/vmd/detail/type_registration.hpp> +#include <boost/vmd/detail/match_single_identifier.hpp> + +/* + + Check to see if the 'id' is BOOST_VMD_TYPE_TYPE + + Returns 1 if it is, else 0 + +*/ + +#define BOOST_VMD_DETAIL_IS_TYPE_TYPE(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_TYPE_TYPE) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_IS_TYPE_TYPE_HPP */ diff --git a/boost/vmd/detail/list.hpp b/boost/vmd/detail/list.hpp new file mode 100644 index 0000000000..815471ba3c --- /dev/null +++ b/boost/vmd/detail/list.hpp @@ -0,0 +1,212 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_LIST_HPP) +#define BOOST_VMD_DETAIL_LIST_HPP + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/pop_back.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/empty_result.hpp> +#include <boost/vmd/detail/identifier.hpp> +#include <boost/vmd/detail/is_list.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/parens.hpp> + +#define BOOST_VMD_DETAIL_LIST_CHECK_FOR_LIST(tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_LIST \ + ( \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + tuple \ + ) \ + ), \ + tuple, \ + (,) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_CHECK_FOR_LIST_D(d,tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_LIST_D \ + ( \ + d, \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + tuple \ + ) \ + ), \ + tuple, \ + (,) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_CHECK_RETURN(tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + tuple \ + ) \ + ), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_LIST_CHECK_FOR_LIST \ + ) \ + (tuple) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_CHECK_RETURN_D(d,tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + tuple \ + ) \ + ), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_LIST_CHECK_FOR_LIST_D \ + ) \ + (d,tuple) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_EMPTY_LIST(list) \ + BOOST_VMD_DETAIL_IDENTIFIER(list,BOOST_PP_NIL,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_EMPTY_LIST_D(d,list) \ + BOOST_VMD_DETAIL_IDENTIFIER_D(d,list,BOOST_PP_NIL,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_TUPLE(param) \ + BOOST_VMD_DETAIL_LIST_CHECK_RETURN \ + ( \ + BOOST_VMD_DETAIL_PARENS(param,BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_TUPLE_D(d,param) \ + BOOST_VMD_DETAIL_LIST_CHECK_RETURN_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_PARENS_D(d,param,BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_EMPTY_PROCESS(tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM(0,tuple) \ + ), \ + (,), \ + tuple \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_EMPTY(list) \ + BOOST_VMD_DETAIL_LIST_EMPTY_PROCESS \ + ( \ + BOOST_VMD_DETAIL_LIST_EMPTY_LIST(list) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_EMPTY_D(d,list) \ + BOOST_VMD_DETAIL_LIST_EMPTY_PROCESS \ + ( \ + BOOST_VMD_DETAIL_LIST_EMPTY_LIST_D(d,list) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_PROCESS(list) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(list), \ + BOOST_VMD_DETAIL_LIST_TUPLE, \ + BOOST_VMD_DETAIL_LIST_EMPTY \ + ) \ + (list) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_SPLIT(list) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(list), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_LIST_PROCESS \ + ) \ + (list) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_BEGIN(list) \ + BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_DETAIL_LIST_SPLIT(list)) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_PROCESS_D(d,list) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(list), \ + BOOST_VMD_DETAIL_LIST_TUPLE_D, \ + BOOST_VMD_DETAIL_LIST_EMPTY_D \ + ) \ + (d,list) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_SPLIT_D(d,list) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(list), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_LIST_PROCESS_D \ + ) \ + (d,list) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_BEGIN_D(d,list) \ + BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_DETAIL_LIST_SPLIT_D(d,list)) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST_D(d,...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ), \ + BOOST_VMD_DETAIL_LIST_SPLIT_D, \ + BOOST_VMD_DETAIL_LIST_BEGIN_D \ + ) \ + (d,BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#define BOOST_VMD_DETAIL_LIST(...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ), \ + BOOST_VMD_DETAIL_LIST_SPLIT, \ + BOOST_VMD_DETAIL_LIST_BEGIN \ + ) \ + (BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_LIST_HPP */ diff --git a/boost/vmd/detail/match_identifier.hpp b/boost/vmd/detail/match_identifier.hpp new file mode 100644 index 0000000000..0b234b2d5f --- /dev/null +++ b/boost/vmd/detail/match_identifier.hpp @@ -0,0 +1,160 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_MATCH_IDENTIFIER_HPP) +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_HPP + +#include <boost/preprocessor/arithmetic/inc.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/comparison/not_equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/control/while.hpp> +#include <boost/preprocessor/logical/bitand.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/replace.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/idprefix.hpp> +#include <boost/vmd/detail/match_identifier_common.hpp> + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_ID(state) \ + BOOST_PP_TUPLE_ELEM(0,state) \ +/**/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_TUPLE(state) \ + BOOST_PP_TUPLE_ELEM(1,state) \ +/**/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_TUPLE_SIZE(state) \ + BOOST_PP_TUPLE_ELEM(2,state) \ +/**/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_CURRENT(state) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_INDEX(state), \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_TUPLE(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_INDEX(state) \ + BOOST_PP_TUPLE_ELEM(3,state) \ +/**/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_RESULT(state) \ + BOOST_PP_TUPLE_ELEM(4,state) \ +/**/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_PRED(d,state) \ + BOOST_PP_BITAND \ + ( \ + BOOST_PP_EQUAL_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_RESULT(state), \ + 0 \ + ), \ + BOOST_PP_NOT_EQUAL_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_INDEX(state), \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_TUPLE_SIZE(state) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_FOUND(d,state) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + 4, \ + BOOST_PP_INC \ + ( \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_INDEX(state) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_CONTINUE(d,state) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + 3, \ + BOOST_PP_INC \ + ( \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_INDEX(state) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_CMP_IDS \ + ( \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_ID(state), \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_CURRENT(state) \ + ), \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_FOUND, \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_CONTINUE \ + ) \ + (d,state) \ +/**/ + +/* + + Return index starting with 1 of the tuple id the identifier matches, or 0 if there are no matches. + +*/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER(id,keytuple) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 4, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_PRED, \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP, \ + ( \ + id, \ + keytuple, \ + BOOST_PP_TUPLE_SIZE(keytuple), \ + 0, \ + 0 \ + ) \ + ) \ + ) \ +/**/ + +/* + + Return index starting with 1 of the tuple id the identifier matches, or 0 if there are no matches. + +*/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_D(d,id,keytuple) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 4, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_PRED, \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP, \ + ( \ + id, \ + keytuple, \ + BOOST_PP_TUPLE_SIZE(keytuple), \ + 0, \ + 0 \ + ) \ + ) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_MATCH_IDENTIFIER_HPP */ diff --git a/boost/vmd/detail/match_identifier_common.hpp b/boost/vmd/detail/match_identifier_common.hpp new file mode 100644 index 0000000000..18e7a578d0 --- /dev/null +++ b/boost/vmd/detail/match_identifier_common.hpp @@ -0,0 +1,37 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_MATCH_IDENTIFIER_COMMON_HPP) +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_COMMON_HPP + +#include <boost/preprocessor/cat.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/idprefix.hpp> + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_CREATE_ID_RESULT(id,keyid) \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_DETAIL_IDENTIFIER_DETECTION_PREFIX, \ + BOOST_PP_CAT \ + ( \ + keyid, \ + BOOST_PP_CAT \ + ( \ + _, \ + id \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_CMP_IDS(id,keyid) \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_CREATE_ID_RESULT(id,keyid) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_MATCH_IDENTIFIER_COMMON_HPP */ diff --git a/boost/vmd/detail/match_single_identifier.hpp b/boost/vmd/detail/match_single_identifier.hpp new file mode 100644 index 0000000000..0913d9f3f6 --- /dev/null +++ b/boost/vmd/detail/match_single_identifier.hpp @@ -0,0 +1,16 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER_HPP) +#define BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER_HPP + +#include <boost/vmd/detail/match_identifier_common.hpp> + +#define BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,key) \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_CMP_IDS(id,key) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER_HPP */ diff --git a/boost/vmd/detail/modifiers.hpp b/boost/vmd/detail/modifiers.hpp new file mode 100644 index 0000000000..c5d46c0a37 --- /dev/null +++ b/boost/vmd/detail/modifiers.hpp @@ -0,0 +1,104 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_MODIFIERS_HPP) +#define BOOST_VMD_DETAIL_MODIFIERS_HPP + +#include <boost/vmd/detail/match_single_identifier.hpp> + +#define BOOST_VMD_REGISTER_BOOST_VMD_RETURN_NO_TYPE (BOOST_VMD_RETURN_NO_TYPE) +#define BOOST_VMD_REGISTER_BOOST_VMD_RETURN_TYPE (BOOST_VMD_RETURN_TYPE) +#define BOOST_VMD_REGISTER_BOOST_VMD_RETURN_TYPE_TUPLE (BOOST_VMD_RETURN_TYPE_TUPLE) +#define BOOST_VMD_REGISTER_BOOST_VMD_RETURN_TYPE_ARRAY (BOOST_VMD_RETURN_TYPE_ARRAY) +#define BOOST_VMD_REGISTER_BOOST_VMD_RETURN_TYPE_LIST (BOOST_VMD_RETURN_TYPE_LIST) + +#define BOOST_VMD_REGISTER_BOOST_VMD_RETURN_AFTER (BOOST_VMD_RETURN_AFTER) +#define BOOST_VMD_REGISTER_BOOST_VMD_RETURN_NO_AFTER (BOOST_VMD_RETURN_NO_AFTER) +#define BOOST_VMD_REGISTER_BOOST_VMD_RETURN_ONLY_AFTER (BOOST_VMD_RETURN_ONLY_AFTER) + +#define BOOST_VMD_REGISTER_BOOST_VMD_RETURN_INDEX (BOOST_VMD_RETURN_INDEX) +#define BOOST_VMD_REGISTER_BOOST_VMD_RETURN_NO_INDEX (BOOST_VMD_RETURN_NO_INDEX) + +#define BOOST_VMD_DETECT_BOOST_VMD_RETURN_NO_TYPE_BOOST_VMD_RETURN_NO_TYPE +#define BOOST_VMD_DETECT_BOOST_VMD_RETURN_TYPE_BOOST_VMD_RETURN_TYPE +#define BOOST_VMD_DETECT_BOOST_VMD_RETURN_TYPE_TUPLE_BOOST_VMD_RETURN_TYPE_TUPLE +#define BOOST_VMD_DETECT_BOOST_VMD_RETURN_TYPE_ARRAY_BOOST_VMD_RETURN_TYPE_ARRAY +#define BOOST_VMD_DETECT_BOOST_VMD_RETURN_TYPE_LIST_BOOST_VMD_RETURN_TYPE_LIST + +#define BOOST_VMD_DETECT_BOOST_VMD_RETURN_AFTER_BOOST_VMD_RETURN_AFTER +#define BOOST_VMD_DETECT_BOOST_VMD_RETURN_NO_AFTER_BOOST_VMD_RETURN_NO_AFTER +#define BOOST_VMD_DETECT_BOOST_VMD_RETURN_ONLY_AFTER_BOOST_VMD_RETURN_ONLY_AFTER + +#define BOOST_VMD_DETECT_BOOST_VMD_RETURN_INDEX_BOOST_VMD_RETURN_INDEX +#define BOOST_VMD_DETECT_BOOST_VMD_RETURN_NO_INDEX_BOOST_VMD_RETURN_NO_INDEX + +#define BOOST_VMD_REGISTER_BOOST_VMD_ALLOW_ALL (BOOST_VMD_ALLOW_ALL) +#define BOOST_VMD_REGISTER_BOOST_VMD_ALLOW_RETURN (BOOST_VMD_ALLOW_RETURN) +#define BOOST_VMD_REGISTER_BOOST_VMD_ALLOW_AFTER (BOOST_VMD_ALLOW_AFTER) +#define BOOST_VMD_REGISTER_BOOST_VMD_ALLOW_INDEX (BOOST_VMD_ALLOW_INDEX) + +#define BOOST_VMD_DETECT_BOOST_VMD_ALLOW_ALL_BOOST_VMD_ALLOW_ALL +#define BOOST_VMD_DETECT_BOOST_VMD_ALLOW_RETURN_BOOST_VMD_ALLOW_RETURN +#define BOOST_VMD_DETECT_BOOST_VMD_ALLOW_AFTER_BOOST_VMD_ALLOW_AFTER +#define BOOST_VMD_DETECT_BOOST_VMD_ALLOW_INDEX_BOOST_VMD_ALLOW_INDEX + +#define BOOST_VMD_DETAIL_IS_RETURN_TYPE_TUPLE(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_RETURN_TYPE_TUPLE) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_RETURN_TYPE_ARRAY(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_RETURN_TYPE_ARRAY) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_RETURN_TYPE_LIST(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_RETURN_TYPE_LIST) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_RETURN_TYPE(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_RETURN_TYPE) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_RETURN_NO_TYPE(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_RETURN_NO_TYPE) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_RETURN_AFTER(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_RETURN_AFTER) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_RETURN_ONLY_AFTER(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_RETURN_ONLY_AFTER) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_RETURN_NO_AFTER(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_RETURN_NO_AFTER) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_RETURN_INDEX(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_RETURN_INDEX) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_RETURN_NO_INDEX(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_RETURN_NO_INDEX) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ALLOW_ALL(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_ALLOW_ALL) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ALLOW_RETURN(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_ALLOW_RETURN) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ALLOW_AFTER(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_ALLOW_AFTER) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_ALLOW_INDEX(id) \ + BOOST_VMD_DETAIL_MATCH_SINGLE_IDENTIFIER(id,BOOST_VMD_ALLOW_INDEX) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_MODIFIERS_HPP */ diff --git a/boost/vmd/detail/mods.hpp b/boost/vmd/detail/mods.hpp new file mode 100644 index 0000000000..84173f4846 --- /dev/null +++ b/boost/vmd/detail/mods.hpp @@ -0,0 +1,707 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_MODS_HPP) +#define BOOST_VMD_DETAIL_MODS_HPP + +#include <boost/preprocessor/arithmetic/inc.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/comparison/greater.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/control/while.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/pop_front.hpp> +#include <boost/preprocessor/tuple/push_back.hpp> +#include <boost/preprocessor/tuple/replace.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/preprocessor/variadic/to_tuple.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_type.hpp> +#include <boost/vmd/detail/modifiers.hpp> + +#define BOOST_VMD_DETAIL_MODS_NO_RETURN 0 +#define BOOST_VMD_DETAIL_MODS_RETURN 1 +#define BOOST_VMD_DETAIL_MODS_RETURN_TUPLE 2 +#define BOOST_VMD_DETAIL_MODS_RETURN_ARRAY 3 +#define BOOST_VMD_DETAIL_MODS_RETURN_LIST 4 +#define BOOST_VMD_DETAIL_MODS_NO_AFTER 0 +#define BOOST_VMD_DETAIL_MODS_RETURN_AFTER 1 +#define BOOST_VMD_DETAIL_MODS_NO_INDEX 0 +#define BOOST_VMD_DETAIL_MODS_RETURN_INDEX 1 +#define BOOST_VMD_DETAIL_MODS_NO_ONLY_AFTER 0 +#define BOOST_VMD_DETAIL_MODS_RETURN_ONLY_AFTER 1 + +#define BOOST_VMD_DETAIL_MODS_TUPLE_RETURN 0 +#define BOOST_VMD_DETAIL_MODS_TUPLE_AFTER 1 +#define BOOST_VMD_DETAIL_MODS_TUPLE_INDEX 2 +#define BOOST_VMD_DETAIL_MODS_TUPLE_OTHER 3 +#define BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER 4 +#define BOOST_VMD_DETAIL_MODS_TUPLE_TYPE 5 + +#define BOOST_VMD_DETAIL_MODS_DATA_INPUT 0 +#define BOOST_VMD_DETAIL_MODS_DATA_INDEX 1 +#define BOOST_VMD_DETAIL_MODS_DATA_SIZE 2 +#define BOOST_VMD_DETAIL_MODS_DATA_RESULT 3 +#define BOOST_VMD_DETAIL_MODS_DATA_ALLOW 4 + +#define BOOST_VMD_DETAIL_MODS_STATE_INPUT(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_INPUT,state) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_INDEX(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_INDEX,state) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_SIZE(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_SIZE,state) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_RESULT(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_RESULT,state) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_ALLOW,state) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_ALL(state) \ + BOOST_VMD_DETAIL_IS_ALLOW_ALL(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_RETURN(state) \ + BOOST_VMD_DETAIL_IS_ALLOW_RETURN(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_AFTER(state) \ + BOOST_VMD_DETAIL_IS_ALLOW_AFTER(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_INDEX(state) \ + BOOST_VMD_DETAIL_IS_ALLOW_INDEX(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_CURRENT(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_STATE_INDEX(state),BOOST_VMD_DETAIL_MODS_STATE_INPUT(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_TYPE(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_RETURN,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_AFTER(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_AFTER,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_ONLY_AFTER(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_STATE_TINDEX(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_INDEX,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_RESULT_RETURN_TYPE(result) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_RETURN,result) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER(result) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_AFTER,result) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_IS_RESULT_ONLY_AFTER(result) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER,result) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_IS_RESULT_INDEX(result) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_INDEX,result) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_RESULT_OTHER(result) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_OTHER,result) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_RESULT_TYPE(result) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_TYPE,result) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_PRED(d,state) \ + BOOST_PP_GREATER_D(d,BOOST_VMD_DETAIL_MODS_STATE_SIZE(state),BOOST_VMD_DETAIL_MODS_STATE_INDEX(state)) +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,number) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_MODS_DATA_RESULT, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_MODS_TUPLE_RETURN, \ + number \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_MODS_DATA_RESULT, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER, \ + 1 \ + ), \ + BOOST_VMD_DETAIL_MODS_TUPLE_AFTER, \ + 1 \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_INDEX(d,state,number) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_MODS_DATA_RESULT, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_MODS_TUPLE_INDEX, \ + number \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_GTT(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN_TUPLE) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ET(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_SA(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN_ARRAY) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_SL(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN_LIST) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_NT(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_NO_RETURN) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_MODS_DATA_RESULT, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_MODS_TUPLE_AFTER, \ + BOOST_VMD_DETAIL_MODS_RETURN_AFTER \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_MODS_DATA_RESULT, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER, \ + 0 \ + ), \ + BOOST_VMD_DETAIL_MODS_TUPLE_AFTER, \ + BOOST_VMD_DETAIL_MODS_NO_AFTER \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_IND(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_INDEX(d,state,BOOST_VMD_DETAIL_MODS_RETURN_INDEX) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_NO_IND(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_INDEX(d,state,BOOST_VMD_DETAIL_MODS_NO_INDEX) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_REPLACE(d,state,id) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_MODS_TUPLE_OTHER, \ + BOOST_PP_VARIADIC_TO_TUPLE(id) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_ADD(d,state,id) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_MODS_TUPLE_OTHER, \ + BOOST_PP_TUPLE_PUSH_BACK \ + ( \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)), \ + id \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE(d,state,id) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \ + ), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_REPLACE, \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_ADD \ + ) \ + (d,state,id) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE_RETURN(d,state,id) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_MODS_TUPLE_RETURN, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,id,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_MODS_RETURN_ARRAY, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,id,BOOST_VMD_TYPE_LIST), \ + BOOST_VMD_DETAIL_MODS_RETURN_LIST, \ + BOOST_VMD_DETAIL_MODS_RETURN_TUPLE \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE(d,state,id) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE_RETURN(d,state,id), \ + BOOST_VMD_DETAIL_MODS_TUPLE_TYPE, \ + id \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_MODS_DATA_RESULT, \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_ALL(state), \ + BOOST_VMD_IS_TYPE_D(d,id) \ + ), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE, \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE \ + ) \ + (d,state,id) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE(d,state) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_MODS_DATA_INDEX, \ + BOOST_PP_INC(BOOST_VMD_DETAIL_MODS_STATE_INDEX(state)) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_ALL(d,state,id) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_TYPE_TUPLE(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_GTT, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_TYPE(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_ET, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_TYPE_ARRAY(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_SA, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_TYPE_LIST(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_SL, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_NO_TYPE(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_NT, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_AFTER(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_NO_AFTER(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_ONLY_AFTER(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_INDEX(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_IND, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_NO_INDEX(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_NO_IND, \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \ + ) \ + ) \ + ) \ + ) \ + ) \ + ) \ + ) \ + ) \ + ) \ + ) \ + (d,state,id) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_RETURN(d,state,id) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_TYPE_TUPLE(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_GTT, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_TYPE(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_ET, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_TYPE_ARRAY(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_SA, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_TYPE_LIST(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_SL, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_NO_TYPE(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_NT, \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \ + ) \ + ) \ + ) \ + ) \ + ) \ + (d,state,id) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_AFTER(d,state,id) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_AFTER(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_NO_AFTER(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_ONLY_AFTER(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER, \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \ + ) \ + ) \ + ) \ + (d,state,id) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_INDEX(d,state,id) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_AFTER(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_NO_AFTER(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_ONLY_AFTER(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_INDEX(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_IND, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_RETURN_NO_INDEX(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_NO_IND, \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \ + ) \ + ) \ + ) \ + ) \ + ) \ + (d,state,id) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_UPDATE(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE(d,state) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ID(d,state,id) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_ALL(state), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_ALL, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_RETURN(state), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_RETURN, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_AFTER(state), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_AFTER, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_INDEX(state), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_INDEX, \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_UPDATE \ + ) \ + ) \ + ) \ + ) \ + (d,state,id) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT_TUPLE(d,state,id) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_MODS_DATA_RESULT, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_MODS_TUPLE_OTHER, \ + id \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP_CURRENT(d,state,id) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(id), \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_TUPLE, \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT_ID \ + ) \ + (d,state,id) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_OP(d,state) \ + BOOST_VMD_DETAIL_MODS_OP_CURRENT(d,state,BOOST_VMD_DETAIL_MODS_STATE_CURRENT(state)) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_LOOP(allow,tuple) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 3, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_MODS_PRED, \ + BOOST_VMD_DETAIL_MODS_OP, \ + ( \ + tuple, \ + 0, \ + BOOST_PP_TUPLE_SIZE(tuple), \ + (0,0,0,,0,), \ + allow \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_MODS_LOOP_D(d,allow,tuple) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 3, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_MODS_PRED, \ + BOOST_VMD_DETAIL_MODS_OP, \ + ( \ + tuple, \ + 0, \ + BOOST_PP_TUPLE_SIZE(tuple), \ + (0,0,0,,0,), \ + allow \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_NEW_MODS_VAR(allow,tuple) \ + BOOST_VMD_DETAIL_MODS_LOOP \ + ( \ + allow, \ + BOOST_PP_TUPLE_POP_FRONT(tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_NEW_MODS_VAR_D(d,allow,tuple) \ + BOOST_VMD_DETAIL_MODS_LOOP_D \ + ( \ + d, \ + allow, \ + BOOST_PP_TUPLE_POP_FRONT(tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_NEW_MODS_IR(allow,tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(tuple),1), \ + BOOST_VMD_IDENTITY((0,0,0,,0,)), \ + BOOST_VMD_DETAIL_NEW_MODS_VAR \ + ) \ + (allow,tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_NEW_MODS_IR_D(d,allow,tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,BOOST_PP_TUPLE_SIZE(tuple),1), \ + BOOST_VMD_IDENTITY((0,0,0,,0,)), \ + BOOST_VMD_DETAIL_NEW_MODS_VAR_D \ + ) \ + (d,allow,tuple) \ + ) \ +/**/ + +/* + + Returns a six-element tuple: + + First tuple element = 0 No type return + 1 Exact type return + 2 General tuple type return + 3 Array return + 4 List return + + Second tuple element = 0 No after return + 1 After return + + Third tuple element = 0 No identifier index + 1 Identifier Index + + Fourth tuple element = Tuple of other identifiers + + Fifth tuple element = 0 No after only return + 1 After only return + + Sixth tuple element = Type identifier + + Input = allow, either + BOOST_VMD_ALLOW_ALL + BOOST_VMD_ALLOW_RETURN + BOOST_VMD_ALLOW_AFTER + BOOST_VMD_ALLOW_INDEX + + ..., modifiers, first variadic is discarded + Possible modifiers are: + + BOOST_VMD_RETURN_NO_TYPE = (0,0) + BOOST_VMD_RETURN_TYPE = (1,0) + BOOST_VMD_RETURN_TYPE_TUPLE = (2,0) + BOOST_VMD_RETURN_TYPE_ARRAY = (3,0) + BOOST_VMD_RETURN_TYPE_LIST = (4,0) + + BOOST_VMD_RETURN_NO_AFTER = (0,0) + BOOST_VMD_RETURN_AFTER = (0,1) + +*/ + +#define BOOST_VMD_DETAIL_NEW_MODS(allow,...) \ + BOOST_VMD_DETAIL_NEW_MODS_IR(allow,BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__)) \ +/**/ + +#define BOOST_VMD_DETAIL_NEW_MODS_D(d,allow,...) \ + BOOST_VMD_DETAIL_NEW_MODS_IR_D(d,allow,BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__)) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_MODS_HPP */ diff --git a/boost/vmd/detail/nil_registration.hpp b/boost/vmd/detail/nil_registration.hpp new file mode 100644 index 0000000000..4a4bdc6283 --- /dev/null +++ b/boost/vmd/detail/nil_registration.hpp @@ -0,0 +1,13 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_NIL_REGISTRATION_HPP) +#define BOOST_VMD_DETAIL_NIL_REGISTRATION_HPP + +#define BOOST_VMD_REGISTER_BOOST_PP_NIL (BOOST_PP_NIL) +#define BOOST_VMD_DETECT_BOOST_PP_NIL_BOOST_PP_NIL + +#endif /* BOOST_VMD_DETAIL_NIL_REGISTRATION_HPP */ diff --git a/boost/vmd/detail/not_empty.hpp b/boost/vmd/detail/not_empty.hpp new file mode 100644 index 0000000000..f6dfb66d75 --- /dev/null +++ b/boost/vmd/detail/not_empty.hpp @@ -0,0 +1,20 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_NOT_EMPTY_HPP) +#define BOOST_VMD_DETAIL_NOT_EMPTY_HPP + +#include <boost/preprocessor/logical/compl.hpp> +#include <boost/vmd/is_empty.hpp> + +#define BOOST_VMD_DETAIL_NOT_EMPTY(par) \ + BOOST_PP_COMPL \ + ( \ + BOOST_VMD_IS_EMPTY(par) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_NOT_EMPTY_HPP */ diff --git a/boost/vmd/detail/number_registration.hpp b/boost/vmd/detail/number_registration.hpp new file mode 100644 index 0000000000..d0110d7e1c --- /dev/null +++ b/boost/vmd/detail/number_registration.hpp @@ -0,0 +1,784 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_NUMBER_REGISTRATION_HPP) +#define BOOST_VMD_DETAIL_IS_NUMBER_REGISTRATION_HPP + +#define BOOST_VMD_REGISTER_0 (0) +#define BOOST_VMD_REGISTER_1 (1) +#define BOOST_VMD_REGISTER_2 (2) +#define BOOST_VMD_REGISTER_3 (3) +#define BOOST_VMD_REGISTER_4 (4) +#define BOOST_VMD_REGISTER_5 (5) +#define BOOST_VMD_REGISTER_6 (6) +#define BOOST_VMD_REGISTER_7 (7) +#define BOOST_VMD_REGISTER_8 (8) +#define BOOST_VMD_REGISTER_9 (9) +#define BOOST_VMD_REGISTER_10 (10) +#define BOOST_VMD_REGISTER_11 (11) +#define BOOST_VMD_REGISTER_12 (12) +#define BOOST_VMD_REGISTER_13 (13) +#define BOOST_VMD_REGISTER_14 (14) +#define BOOST_VMD_REGISTER_15 (15) +#define BOOST_VMD_REGISTER_16 (16) +#define BOOST_VMD_REGISTER_17 (17) +#define BOOST_VMD_REGISTER_18 (18) +#define BOOST_VMD_REGISTER_19 (19) +#define BOOST_VMD_REGISTER_20 (20) +#define BOOST_VMD_REGISTER_21 (21) +#define BOOST_VMD_REGISTER_22 (22) +#define BOOST_VMD_REGISTER_23 (23) +#define BOOST_VMD_REGISTER_24 (24) +#define BOOST_VMD_REGISTER_25 (25) +#define BOOST_VMD_REGISTER_26 (26) +#define BOOST_VMD_REGISTER_27 (27) +#define BOOST_VMD_REGISTER_28 (28) +#define BOOST_VMD_REGISTER_29 (29) +#define BOOST_VMD_REGISTER_30 (30) +#define BOOST_VMD_REGISTER_31 (31) +#define BOOST_VMD_REGISTER_32 (32) +#define BOOST_VMD_REGISTER_33 (33) +#define BOOST_VMD_REGISTER_34 (34) +#define BOOST_VMD_REGISTER_35 (35) +#define BOOST_VMD_REGISTER_36 (36) +#define BOOST_VMD_REGISTER_37 (37) +#define BOOST_VMD_REGISTER_38 (38) +#define BOOST_VMD_REGISTER_39 (39) +#define BOOST_VMD_REGISTER_40 (40) +#define BOOST_VMD_REGISTER_41 (41) +#define BOOST_VMD_REGISTER_42 (42) +#define BOOST_VMD_REGISTER_43 (43) +#define BOOST_VMD_REGISTER_44 (44) +#define BOOST_VMD_REGISTER_45 (45) +#define BOOST_VMD_REGISTER_46 (46) +#define BOOST_VMD_REGISTER_47 (47) +#define BOOST_VMD_REGISTER_48 (48) +#define BOOST_VMD_REGISTER_49 (49) +#define BOOST_VMD_REGISTER_50 (50) +#define BOOST_VMD_REGISTER_51 (51) +#define BOOST_VMD_REGISTER_52 (52) +#define BOOST_VMD_REGISTER_53 (53) +#define BOOST_VMD_REGISTER_54 (54) +#define BOOST_VMD_REGISTER_55 (55) +#define BOOST_VMD_REGISTER_56 (56) +#define BOOST_VMD_REGISTER_57 (57) +#define BOOST_VMD_REGISTER_58 (58) +#define BOOST_VMD_REGISTER_59 (59) +#define BOOST_VMD_REGISTER_60 (60) +#define BOOST_VMD_REGISTER_61 (61) +#define BOOST_VMD_REGISTER_62 (62) +#define BOOST_VMD_REGISTER_63 (63) +#define BOOST_VMD_REGISTER_64 (64) +#define BOOST_VMD_REGISTER_65 (65) +#define BOOST_VMD_REGISTER_66 (66) +#define BOOST_VMD_REGISTER_67 (67) +#define BOOST_VMD_REGISTER_68 (68) +#define BOOST_VMD_REGISTER_69 (69) +#define BOOST_VMD_REGISTER_70 (70) +#define BOOST_VMD_REGISTER_71 (71) +#define BOOST_VMD_REGISTER_72 (72) +#define BOOST_VMD_REGISTER_73 (73) +#define BOOST_VMD_REGISTER_74 (74) +#define BOOST_VMD_REGISTER_75 (75) +#define BOOST_VMD_REGISTER_76 (76) +#define BOOST_VMD_REGISTER_77 (77) +#define BOOST_VMD_REGISTER_78 (78) +#define BOOST_VMD_REGISTER_79 (79) +#define BOOST_VMD_REGISTER_80 (80) +#define BOOST_VMD_REGISTER_81 (81) +#define BOOST_VMD_REGISTER_82 (82) +#define BOOST_VMD_REGISTER_83 (83) +#define BOOST_VMD_REGISTER_84 (84) +#define BOOST_VMD_REGISTER_85 (85) +#define BOOST_VMD_REGISTER_86 (86) +#define BOOST_VMD_REGISTER_87 (87) +#define BOOST_VMD_REGISTER_88 (88) +#define BOOST_VMD_REGISTER_89 (89) +#define BOOST_VMD_REGISTER_90 (90) +#define BOOST_VMD_REGISTER_91 (91) +#define BOOST_VMD_REGISTER_92 (92) +#define BOOST_VMD_REGISTER_93 (93) +#define BOOST_VMD_REGISTER_94 (94) +#define BOOST_VMD_REGISTER_95 (95) +#define BOOST_VMD_REGISTER_96 (96) +#define BOOST_VMD_REGISTER_97 (97) +#define BOOST_VMD_REGISTER_98 (98) +#define BOOST_VMD_REGISTER_99 (99) +#define BOOST_VMD_REGISTER_100 (100) +#define BOOST_VMD_REGISTER_101 (101) +#define BOOST_VMD_REGISTER_102 (102) +#define BOOST_VMD_REGISTER_103 (103) +#define BOOST_VMD_REGISTER_104 (104) +#define BOOST_VMD_REGISTER_105 (105) +#define BOOST_VMD_REGISTER_106 (106) +#define BOOST_VMD_REGISTER_107 (107) +#define BOOST_VMD_REGISTER_108 (108) +#define BOOST_VMD_REGISTER_109 (109) +#define BOOST_VMD_REGISTER_110 (110) +#define BOOST_VMD_REGISTER_111 (111) +#define BOOST_VMD_REGISTER_112 (112) +#define BOOST_VMD_REGISTER_113 (113) +#define BOOST_VMD_REGISTER_114 (114) +#define BOOST_VMD_REGISTER_115 (115) +#define BOOST_VMD_REGISTER_116 (116) +#define BOOST_VMD_REGISTER_117 (117) +#define BOOST_VMD_REGISTER_118 (118) +#define BOOST_VMD_REGISTER_119 (119) +#define BOOST_VMD_REGISTER_120 (120) +#define BOOST_VMD_REGISTER_121 (121) +#define BOOST_VMD_REGISTER_122 (122) +#define BOOST_VMD_REGISTER_123 (123) +#define BOOST_VMD_REGISTER_124 (124) +#define BOOST_VMD_REGISTER_125 (125) +#define BOOST_VMD_REGISTER_126 (126) +#define BOOST_VMD_REGISTER_127 (127) +#define BOOST_VMD_REGISTER_128 (128) +#define BOOST_VMD_REGISTER_129 (129) +#define BOOST_VMD_REGISTER_130 (130) +#define BOOST_VMD_REGISTER_131 (131) +#define BOOST_VMD_REGISTER_132 (132) +#define BOOST_VMD_REGISTER_133 (133) +#define BOOST_VMD_REGISTER_134 (134) +#define BOOST_VMD_REGISTER_135 (135) +#define BOOST_VMD_REGISTER_136 (136) +#define BOOST_VMD_REGISTER_137 (137) +#define BOOST_VMD_REGISTER_138 (138) +#define BOOST_VMD_REGISTER_139 (139) +#define BOOST_VMD_REGISTER_140 (140) +#define BOOST_VMD_REGISTER_141 (141) +#define BOOST_VMD_REGISTER_142 (142) +#define BOOST_VMD_REGISTER_143 (143) +#define BOOST_VMD_REGISTER_144 (144) +#define BOOST_VMD_REGISTER_145 (145) +#define BOOST_VMD_REGISTER_146 (146) +#define BOOST_VMD_REGISTER_147 (147) +#define BOOST_VMD_REGISTER_148 (148) +#define BOOST_VMD_REGISTER_149 (149) +#define BOOST_VMD_REGISTER_150 (150) +#define BOOST_VMD_REGISTER_151 (151) +#define BOOST_VMD_REGISTER_152 (152) +#define BOOST_VMD_REGISTER_153 (153) +#define BOOST_VMD_REGISTER_154 (154) +#define BOOST_VMD_REGISTER_155 (155) +#define BOOST_VMD_REGISTER_156 (156) +#define BOOST_VMD_REGISTER_157 (157) +#define BOOST_VMD_REGISTER_158 (158) +#define BOOST_VMD_REGISTER_159 (159) +#define BOOST_VMD_REGISTER_160 (160) +#define BOOST_VMD_REGISTER_161 (161) +#define BOOST_VMD_REGISTER_162 (162) +#define BOOST_VMD_REGISTER_163 (163) +#define BOOST_VMD_REGISTER_164 (164) +#define BOOST_VMD_REGISTER_165 (165) +#define BOOST_VMD_REGISTER_166 (166) +#define BOOST_VMD_REGISTER_167 (167) +#define BOOST_VMD_REGISTER_168 (168) +#define BOOST_VMD_REGISTER_169 (169) +#define BOOST_VMD_REGISTER_170 (170) +#define BOOST_VMD_REGISTER_171 (171) +#define BOOST_VMD_REGISTER_172 (172) +#define BOOST_VMD_REGISTER_173 (173) +#define BOOST_VMD_REGISTER_174 (174) +#define BOOST_VMD_REGISTER_175 (175) +#define BOOST_VMD_REGISTER_176 (176) +#define BOOST_VMD_REGISTER_177 (177) +#define BOOST_VMD_REGISTER_178 (178) +#define BOOST_VMD_REGISTER_179 (179) +#define BOOST_VMD_REGISTER_180 (180) +#define BOOST_VMD_REGISTER_181 (181) +#define BOOST_VMD_REGISTER_182 (182) +#define BOOST_VMD_REGISTER_183 (183) +#define BOOST_VMD_REGISTER_184 (184) +#define BOOST_VMD_REGISTER_185 (185) +#define BOOST_VMD_REGISTER_186 (186) +#define BOOST_VMD_REGISTER_187 (187) +#define BOOST_VMD_REGISTER_188 (188) +#define BOOST_VMD_REGISTER_189 (189) +#define BOOST_VMD_REGISTER_190 (190) +#define BOOST_VMD_REGISTER_191 (191) +#define BOOST_VMD_REGISTER_192 (192) +#define BOOST_VMD_REGISTER_193 (193) +#define BOOST_VMD_REGISTER_194 (194) +#define BOOST_VMD_REGISTER_195 (195) +#define BOOST_VMD_REGISTER_196 (196) +#define BOOST_VMD_REGISTER_197 (197) +#define BOOST_VMD_REGISTER_198 (198) +#define BOOST_VMD_REGISTER_199 (199) +#define BOOST_VMD_REGISTER_200 (200) +#define BOOST_VMD_REGISTER_201 (201) +#define BOOST_VMD_REGISTER_202 (202) +#define BOOST_VMD_REGISTER_203 (203) +#define BOOST_VMD_REGISTER_204 (204) +#define BOOST_VMD_REGISTER_205 (205) +#define BOOST_VMD_REGISTER_206 (206) +#define BOOST_VMD_REGISTER_207 (207) +#define BOOST_VMD_REGISTER_208 (208) +#define BOOST_VMD_REGISTER_209 (209) +#define BOOST_VMD_REGISTER_210 (210) +#define BOOST_VMD_REGISTER_211 (211) +#define BOOST_VMD_REGISTER_212 (212) +#define BOOST_VMD_REGISTER_213 (213) +#define BOOST_VMD_REGISTER_214 (214) +#define BOOST_VMD_REGISTER_215 (215) +#define BOOST_VMD_REGISTER_216 (216) +#define BOOST_VMD_REGISTER_217 (217) +#define BOOST_VMD_REGISTER_218 (218) +#define BOOST_VMD_REGISTER_219 (219) +#define BOOST_VMD_REGISTER_220 (220) +#define BOOST_VMD_REGISTER_221 (221) +#define BOOST_VMD_REGISTER_222 (222) +#define BOOST_VMD_REGISTER_223 (223) +#define BOOST_VMD_REGISTER_224 (224) +#define BOOST_VMD_REGISTER_225 (225) +#define BOOST_VMD_REGISTER_226 (226) +#define BOOST_VMD_REGISTER_227 (227) +#define BOOST_VMD_REGISTER_228 (228) +#define BOOST_VMD_REGISTER_229 (229) +#define BOOST_VMD_REGISTER_230 (230) +#define BOOST_VMD_REGISTER_231 (231) +#define BOOST_VMD_REGISTER_232 (232) +#define BOOST_VMD_REGISTER_233 (233) +#define BOOST_VMD_REGISTER_234 (234) +#define BOOST_VMD_REGISTER_235 (235) +#define BOOST_VMD_REGISTER_236 (236) +#define BOOST_VMD_REGISTER_237 (237) +#define BOOST_VMD_REGISTER_238 (238) +#define BOOST_VMD_REGISTER_239 (239) +#define BOOST_VMD_REGISTER_240 (240) +#define BOOST_VMD_REGISTER_241 (241) +#define BOOST_VMD_REGISTER_242 (242) +#define BOOST_VMD_REGISTER_243 (243) +#define BOOST_VMD_REGISTER_244 (244) +#define BOOST_VMD_REGISTER_245 (245) +#define BOOST_VMD_REGISTER_246 (246) +#define BOOST_VMD_REGISTER_247 (247) +#define BOOST_VMD_REGISTER_248 (248) +#define BOOST_VMD_REGISTER_249 (249) +#define BOOST_VMD_REGISTER_250 (250) +#define BOOST_VMD_REGISTER_251 (251) +#define BOOST_VMD_REGISTER_252 (252) +#define BOOST_VMD_REGISTER_253 (253) +#define BOOST_VMD_REGISTER_254 (254) +#define BOOST_VMD_REGISTER_255 (255) +#define BOOST_VMD_REGISTER_256 (256) + +#define BOOST_VMD_DETECT_0_0 +#define BOOST_VMD_DETECT_1_1 +#define BOOST_VMD_DETECT_2_2 +#define BOOST_VMD_DETECT_3_3 +#define BOOST_VMD_DETECT_4_4 +#define BOOST_VMD_DETECT_5_5 +#define BOOST_VMD_DETECT_6_6 +#define BOOST_VMD_DETECT_7_7 +#define BOOST_VMD_DETECT_8_8 +#define BOOST_VMD_DETECT_9_9 +#define BOOST_VMD_DETECT_10_10 +#define BOOST_VMD_DETECT_11_11 +#define BOOST_VMD_DETECT_12_12 +#define BOOST_VMD_DETECT_13_13 +#define BOOST_VMD_DETECT_14_14 +#define BOOST_VMD_DETECT_15_15 +#define BOOST_VMD_DETECT_16_16 +#define BOOST_VMD_DETECT_17_17 +#define BOOST_VMD_DETECT_18_18 +#define BOOST_VMD_DETECT_19_19 +#define BOOST_VMD_DETECT_20_20 +#define BOOST_VMD_DETECT_21_21 +#define BOOST_VMD_DETECT_22_22 +#define BOOST_VMD_DETECT_23_23 +#define BOOST_VMD_DETECT_24_24 +#define BOOST_VMD_DETECT_25_25 +#define BOOST_VMD_DETECT_26_26 +#define BOOST_VMD_DETECT_27_27 +#define BOOST_VMD_DETECT_28_28 +#define BOOST_VMD_DETECT_29_29 +#define BOOST_VMD_DETECT_30_30 +#define BOOST_VMD_DETECT_31_31 +#define BOOST_VMD_DETECT_32_32 +#define BOOST_VMD_DETECT_33_33 +#define BOOST_VMD_DETECT_34_34 +#define BOOST_VMD_DETECT_35_35 +#define BOOST_VMD_DETECT_36_36 +#define BOOST_VMD_DETECT_37_37 +#define BOOST_VMD_DETECT_38_38 +#define BOOST_VMD_DETECT_39_39 +#define BOOST_VMD_DETECT_40_40 +#define BOOST_VMD_DETECT_41_41 +#define BOOST_VMD_DETECT_42_42 +#define BOOST_VMD_DETECT_43_43 +#define BOOST_VMD_DETECT_44_44 +#define BOOST_VMD_DETECT_45_45 +#define BOOST_VMD_DETECT_46_46 +#define BOOST_VMD_DETECT_47_47 +#define BOOST_VMD_DETECT_48_48 +#define BOOST_VMD_DETECT_49_49 +#define BOOST_VMD_DETECT_50_50 +#define BOOST_VMD_DETECT_51_51 +#define BOOST_VMD_DETECT_52_52 +#define BOOST_VMD_DETECT_53_53 +#define BOOST_VMD_DETECT_54_54 +#define BOOST_VMD_DETECT_55_55 +#define BOOST_VMD_DETECT_56_56 +#define BOOST_VMD_DETECT_57_57 +#define BOOST_VMD_DETECT_58_58 +#define BOOST_VMD_DETECT_59_59 +#define BOOST_VMD_DETECT_60_60 +#define BOOST_VMD_DETECT_61_61 +#define BOOST_VMD_DETECT_62_62 +#define BOOST_VMD_DETECT_63_63 +#define BOOST_VMD_DETECT_64_64 +#define BOOST_VMD_DETECT_65_65 +#define BOOST_VMD_DETECT_66_66 +#define BOOST_VMD_DETECT_67_67 +#define BOOST_VMD_DETECT_68_68 +#define BOOST_VMD_DETECT_69_69 +#define BOOST_VMD_DETECT_70_70 +#define BOOST_VMD_DETECT_71_71 +#define BOOST_VMD_DETECT_72_72 +#define BOOST_VMD_DETECT_73_73 +#define BOOST_VMD_DETECT_74_74 +#define BOOST_VMD_DETECT_75_75 +#define BOOST_VMD_DETECT_76_76 +#define BOOST_VMD_DETECT_77_77 +#define BOOST_VMD_DETECT_78_78 +#define BOOST_VMD_DETECT_79_79 +#define BOOST_VMD_DETECT_80_80 +#define BOOST_VMD_DETECT_81_81 +#define BOOST_VMD_DETECT_82_82 +#define BOOST_VMD_DETECT_83_83 +#define BOOST_VMD_DETECT_84_84 +#define BOOST_VMD_DETECT_85_85 +#define BOOST_VMD_DETECT_86_86 +#define BOOST_VMD_DETECT_87_87 +#define BOOST_VMD_DETECT_88_88 +#define BOOST_VMD_DETECT_89_89 +#define BOOST_VMD_DETECT_90_90 +#define BOOST_VMD_DETECT_91_91 +#define BOOST_VMD_DETECT_92_92 +#define BOOST_VMD_DETECT_93_93 +#define BOOST_VMD_DETECT_94_94 +#define BOOST_VMD_DETECT_95_95 +#define BOOST_VMD_DETECT_96_96 +#define BOOST_VMD_DETECT_97_97 +#define BOOST_VMD_DETECT_98_98 +#define BOOST_VMD_DETECT_99_99 +#define BOOST_VMD_DETECT_100_100 +#define BOOST_VMD_DETECT_101_101 +#define BOOST_VMD_DETECT_102_102 +#define BOOST_VMD_DETECT_103_103 +#define BOOST_VMD_DETECT_104_104 +#define BOOST_VMD_DETECT_105_105 +#define BOOST_VMD_DETECT_106_106 +#define BOOST_VMD_DETECT_107_107 +#define BOOST_VMD_DETECT_108_108 +#define BOOST_VMD_DETECT_109_109 +#define BOOST_VMD_DETECT_110_110 +#define BOOST_VMD_DETECT_111_111 +#define BOOST_VMD_DETECT_112_112 +#define BOOST_VMD_DETECT_113_113 +#define BOOST_VMD_DETECT_114_114 +#define BOOST_VMD_DETECT_115_115 +#define BOOST_VMD_DETECT_116_116 +#define BOOST_VMD_DETECT_117_117 +#define BOOST_VMD_DETECT_118_118 +#define BOOST_VMD_DETECT_119_119 +#define BOOST_VMD_DETECT_120_120 +#define BOOST_VMD_DETECT_121_121 +#define BOOST_VMD_DETECT_122_122 +#define BOOST_VMD_DETECT_123_123 +#define BOOST_VMD_DETECT_124_124 +#define BOOST_VMD_DETECT_125_125 +#define BOOST_VMD_DETECT_126_126 +#define BOOST_VMD_DETECT_127_127 +#define BOOST_VMD_DETECT_128_128 +#define BOOST_VMD_DETECT_129_129 +#define BOOST_VMD_DETECT_130_130 +#define BOOST_VMD_DETECT_131_131 +#define BOOST_VMD_DETECT_132_132 +#define BOOST_VMD_DETECT_133_133 +#define BOOST_VMD_DETECT_134_134 +#define BOOST_VMD_DETECT_135_135 +#define BOOST_VMD_DETECT_136_136 +#define BOOST_VMD_DETECT_137_137 +#define BOOST_VMD_DETECT_138_138 +#define BOOST_VMD_DETECT_139_139 +#define BOOST_VMD_DETECT_140_140 +#define BOOST_VMD_DETECT_141_141 +#define BOOST_VMD_DETECT_142_142 +#define BOOST_VMD_DETECT_143_143 +#define BOOST_VMD_DETECT_144_144 +#define BOOST_VMD_DETECT_145_145 +#define BOOST_VMD_DETECT_146_146 +#define BOOST_VMD_DETECT_147_147 +#define BOOST_VMD_DETECT_148_148 +#define BOOST_VMD_DETECT_149_149 +#define BOOST_VMD_DETECT_150_150 +#define BOOST_VMD_DETECT_151_151 +#define BOOST_VMD_DETECT_152_152 +#define BOOST_VMD_DETECT_153_153 +#define BOOST_VMD_DETECT_154_154 +#define BOOST_VMD_DETECT_155_155 +#define BOOST_VMD_DETECT_156_156 +#define BOOST_VMD_DETECT_157_157 +#define BOOST_VMD_DETECT_158_158 +#define BOOST_VMD_DETECT_159_159 +#define BOOST_VMD_DETECT_160_160 +#define BOOST_VMD_DETECT_161_161 +#define BOOST_VMD_DETECT_162_162 +#define BOOST_VMD_DETECT_163_163 +#define BOOST_VMD_DETECT_164_164 +#define BOOST_VMD_DETECT_165_165 +#define BOOST_VMD_DETECT_166_166 +#define BOOST_VMD_DETECT_167_167 +#define BOOST_VMD_DETECT_168_168 +#define BOOST_VMD_DETECT_169_169 +#define BOOST_VMD_DETECT_170_170 +#define BOOST_VMD_DETECT_171_171 +#define BOOST_VMD_DETECT_172_172 +#define BOOST_VMD_DETECT_173_173 +#define BOOST_VMD_DETECT_174_174 +#define BOOST_VMD_DETECT_175_175 +#define BOOST_VMD_DETECT_176_176 +#define BOOST_VMD_DETECT_177_177 +#define BOOST_VMD_DETECT_178_178 +#define BOOST_VMD_DETECT_179_179 +#define BOOST_VMD_DETECT_180_180 +#define BOOST_VMD_DETECT_181_181 +#define BOOST_VMD_DETECT_182_182 +#define BOOST_VMD_DETECT_183_183 +#define BOOST_VMD_DETECT_184_184 +#define BOOST_VMD_DETECT_185_185 +#define BOOST_VMD_DETECT_186_186 +#define BOOST_VMD_DETECT_187_187 +#define BOOST_VMD_DETECT_188_188 +#define BOOST_VMD_DETECT_189_189 +#define BOOST_VMD_DETECT_190_190 +#define BOOST_VMD_DETECT_191_191 +#define BOOST_VMD_DETECT_192_192 +#define BOOST_VMD_DETECT_193_193 +#define BOOST_VMD_DETECT_194_194 +#define BOOST_VMD_DETECT_195_195 +#define BOOST_VMD_DETECT_196_196 +#define BOOST_VMD_DETECT_197_197 +#define BOOST_VMD_DETECT_198_198 +#define BOOST_VMD_DETECT_199_199 +#define BOOST_VMD_DETECT_200_200 +#define BOOST_VMD_DETECT_201_201 +#define BOOST_VMD_DETECT_202_202 +#define BOOST_VMD_DETECT_203_203 +#define BOOST_VMD_DETECT_204_204 +#define BOOST_VMD_DETECT_205_205 +#define BOOST_VMD_DETECT_206_206 +#define BOOST_VMD_DETECT_207_207 +#define BOOST_VMD_DETECT_208_208 +#define BOOST_VMD_DETECT_209_209 +#define BOOST_VMD_DETECT_210_210 +#define BOOST_VMD_DETECT_211_211 +#define BOOST_VMD_DETECT_212_212 +#define BOOST_VMD_DETECT_213_213 +#define BOOST_VMD_DETECT_214_214 +#define BOOST_VMD_DETECT_215_215 +#define BOOST_VMD_DETECT_216_216 +#define BOOST_VMD_DETECT_217_217 +#define BOOST_VMD_DETECT_218_218 +#define BOOST_VMD_DETECT_219_219 +#define BOOST_VMD_DETECT_220_220 +#define BOOST_VMD_DETECT_221_221 +#define BOOST_VMD_DETECT_222_222 +#define BOOST_VMD_DETECT_223_223 +#define BOOST_VMD_DETECT_224_224 +#define BOOST_VMD_DETECT_225_225 +#define BOOST_VMD_DETECT_226_226 +#define BOOST_VMD_DETECT_227_227 +#define BOOST_VMD_DETECT_228_228 +#define BOOST_VMD_DETECT_229_229 +#define BOOST_VMD_DETECT_230_230 +#define BOOST_VMD_DETECT_231_231 +#define BOOST_VMD_DETECT_232_232 +#define BOOST_VMD_DETECT_233_233 +#define BOOST_VMD_DETECT_234_234 +#define BOOST_VMD_DETECT_235_235 +#define BOOST_VMD_DETECT_236_236 +#define BOOST_VMD_DETECT_237_237 +#define BOOST_VMD_DETECT_238_238 +#define BOOST_VMD_DETECT_239_239 +#define BOOST_VMD_DETECT_240_240 +#define BOOST_VMD_DETECT_241_241 +#define BOOST_VMD_DETECT_242_242 +#define BOOST_VMD_DETECT_243_243 +#define BOOST_VMD_DETECT_244_244 +#define BOOST_VMD_DETECT_245_245 +#define BOOST_VMD_DETECT_246_246 +#define BOOST_VMD_DETECT_247_247 +#define BOOST_VMD_DETECT_248_248 +#define BOOST_VMD_DETECT_249_249 +#define BOOST_VMD_DETECT_250_250 +#define BOOST_VMD_DETECT_251_251 +#define BOOST_VMD_DETECT_252_252 +#define BOOST_VMD_DETECT_253_253 +#define BOOST_VMD_DETECT_254_254 +#define BOOST_VMD_DETECT_255_255 +#define BOOST_VMD_DETECT_256_256 + +#define BOOST_VMD_SUBTYPE_REGISTER_0 (BOOST_VMD_TYPE_NUMBER,0) +#define BOOST_VMD_SUBTYPE_REGISTER_1 (BOOST_VMD_TYPE_NUMBER,1) +#define BOOST_VMD_SUBTYPE_REGISTER_2 (BOOST_VMD_TYPE_NUMBER,2) +#define BOOST_VMD_SUBTYPE_REGISTER_3 (BOOST_VMD_TYPE_NUMBER,3) +#define BOOST_VMD_SUBTYPE_REGISTER_4 (BOOST_VMD_TYPE_NUMBER,4) +#define BOOST_VMD_SUBTYPE_REGISTER_5 (BOOST_VMD_TYPE_NUMBER,5) +#define BOOST_VMD_SUBTYPE_REGISTER_6 (BOOST_VMD_TYPE_NUMBER,6) +#define BOOST_VMD_SUBTYPE_REGISTER_7 (BOOST_VMD_TYPE_NUMBER,7) +#define BOOST_VMD_SUBTYPE_REGISTER_8 (BOOST_VMD_TYPE_NUMBER,8) +#define BOOST_VMD_SUBTYPE_REGISTER_9 (BOOST_VMD_TYPE_NUMBER,9) +#define BOOST_VMD_SUBTYPE_REGISTER_10 (BOOST_VMD_TYPE_NUMBER,10) +#define BOOST_VMD_SUBTYPE_REGISTER_11 (BOOST_VMD_TYPE_NUMBER,11) +#define BOOST_VMD_SUBTYPE_REGISTER_12 (BOOST_VMD_TYPE_NUMBER,12) +#define BOOST_VMD_SUBTYPE_REGISTER_13 (BOOST_VMD_TYPE_NUMBER,13) +#define BOOST_VMD_SUBTYPE_REGISTER_14 (BOOST_VMD_TYPE_NUMBER,14) +#define BOOST_VMD_SUBTYPE_REGISTER_15 (BOOST_VMD_TYPE_NUMBER,15) +#define BOOST_VMD_SUBTYPE_REGISTER_16 (BOOST_VMD_TYPE_NUMBER,16) +#define BOOST_VMD_SUBTYPE_REGISTER_17 (BOOST_VMD_TYPE_NUMBER,17) +#define BOOST_VMD_SUBTYPE_REGISTER_18 (BOOST_VMD_TYPE_NUMBER,18) +#define BOOST_VMD_SUBTYPE_REGISTER_19 (BOOST_VMD_TYPE_NUMBER,19) +#define BOOST_VMD_SUBTYPE_REGISTER_20 (BOOST_VMD_TYPE_NUMBER,20) +#define BOOST_VMD_SUBTYPE_REGISTER_21 (BOOST_VMD_TYPE_NUMBER,21) +#define BOOST_VMD_SUBTYPE_REGISTER_22 (BOOST_VMD_TYPE_NUMBER,22) +#define BOOST_VMD_SUBTYPE_REGISTER_23 (BOOST_VMD_TYPE_NUMBER,23) +#define BOOST_VMD_SUBTYPE_REGISTER_24 (BOOST_VMD_TYPE_NUMBER,24) +#define BOOST_VMD_SUBTYPE_REGISTER_25 (BOOST_VMD_TYPE_NUMBER,25) +#define BOOST_VMD_SUBTYPE_REGISTER_26 (BOOST_VMD_TYPE_NUMBER,26) +#define BOOST_VMD_SUBTYPE_REGISTER_27 (BOOST_VMD_TYPE_NUMBER,27) +#define BOOST_VMD_SUBTYPE_REGISTER_28 (BOOST_VMD_TYPE_NUMBER,28) +#define BOOST_VMD_SUBTYPE_REGISTER_29 (BOOST_VMD_TYPE_NUMBER,29) +#define BOOST_VMD_SUBTYPE_REGISTER_30 (BOOST_VMD_TYPE_NUMBER,30) +#define BOOST_VMD_SUBTYPE_REGISTER_31 (BOOST_VMD_TYPE_NUMBER,31) +#define BOOST_VMD_SUBTYPE_REGISTER_32 (BOOST_VMD_TYPE_NUMBER,32) +#define BOOST_VMD_SUBTYPE_REGISTER_33 (BOOST_VMD_TYPE_NUMBER,33) +#define BOOST_VMD_SUBTYPE_REGISTER_34 (BOOST_VMD_TYPE_NUMBER,34) +#define BOOST_VMD_SUBTYPE_REGISTER_35 (BOOST_VMD_TYPE_NUMBER,35) +#define BOOST_VMD_SUBTYPE_REGISTER_36 (BOOST_VMD_TYPE_NUMBER,36) +#define BOOST_VMD_SUBTYPE_REGISTER_37 (BOOST_VMD_TYPE_NUMBER,37) +#define BOOST_VMD_SUBTYPE_REGISTER_38 (BOOST_VMD_TYPE_NUMBER,38) +#define BOOST_VMD_SUBTYPE_REGISTER_39 (BOOST_VMD_TYPE_NUMBER,39) +#define BOOST_VMD_SUBTYPE_REGISTER_40 (BOOST_VMD_TYPE_NUMBER,40) +#define BOOST_VMD_SUBTYPE_REGISTER_41 (BOOST_VMD_TYPE_NUMBER,41) +#define BOOST_VMD_SUBTYPE_REGISTER_42 (BOOST_VMD_TYPE_NUMBER,42) +#define BOOST_VMD_SUBTYPE_REGISTER_43 (BOOST_VMD_TYPE_NUMBER,43) +#define BOOST_VMD_SUBTYPE_REGISTER_44 (BOOST_VMD_TYPE_NUMBER,44) +#define BOOST_VMD_SUBTYPE_REGISTER_45 (BOOST_VMD_TYPE_NUMBER,45) +#define BOOST_VMD_SUBTYPE_REGISTER_46 (BOOST_VMD_TYPE_NUMBER,46) +#define BOOST_VMD_SUBTYPE_REGISTER_47 (BOOST_VMD_TYPE_NUMBER,47) +#define BOOST_VMD_SUBTYPE_REGISTER_48 (BOOST_VMD_TYPE_NUMBER,48) +#define BOOST_VMD_SUBTYPE_REGISTER_49 (BOOST_VMD_TYPE_NUMBER,49) +#define BOOST_VMD_SUBTYPE_REGISTER_50 (BOOST_VMD_TYPE_NUMBER,50) +#define BOOST_VMD_SUBTYPE_REGISTER_51 (BOOST_VMD_TYPE_NUMBER,51) +#define BOOST_VMD_SUBTYPE_REGISTER_52 (BOOST_VMD_TYPE_NUMBER,52) +#define BOOST_VMD_SUBTYPE_REGISTER_53 (BOOST_VMD_TYPE_NUMBER,53) +#define BOOST_VMD_SUBTYPE_REGISTER_54 (BOOST_VMD_TYPE_NUMBER,54) +#define BOOST_VMD_SUBTYPE_REGISTER_55 (BOOST_VMD_TYPE_NUMBER,55) +#define BOOST_VMD_SUBTYPE_REGISTER_56 (BOOST_VMD_TYPE_NUMBER,56) +#define BOOST_VMD_SUBTYPE_REGISTER_57 (BOOST_VMD_TYPE_NUMBER,57) +#define BOOST_VMD_SUBTYPE_REGISTER_58 (BOOST_VMD_TYPE_NUMBER,58) +#define BOOST_VMD_SUBTYPE_REGISTER_59 (BOOST_VMD_TYPE_NUMBER,59) +#define BOOST_VMD_SUBTYPE_REGISTER_60 (BOOST_VMD_TYPE_NUMBER,60) +#define BOOST_VMD_SUBTYPE_REGISTER_61 (BOOST_VMD_TYPE_NUMBER,61) +#define BOOST_VMD_SUBTYPE_REGISTER_62 (BOOST_VMD_TYPE_NUMBER,62) +#define BOOST_VMD_SUBTYPE_REGISTER_63 (BOOST_VMD_TYPE_NUMBER,63) +#define BOOST_VMD_SUBTYPE_REGISTER_64 (BOOST_VMD_TYPE_NUMBER,64) +#define BOOST_VMD_SUBTYPE_REGISTER_65 (BOOST_VMD_TYPE_NUMBER,65) +#define BOOST_VMD_SUBTYPE_REGISTER_66 (BOOST_VMD_TYPE_NUMBER,66) +#define BOOST_VMD_SUBTYPE_REGISTER_67 (BOOST_VMD_TYPE_NUMBER,67) +#define BOOST_VMD_SUBTYPE_REGISTER_68 (BOOST_VMD_TYPE_NUMBER,68) +#define BOOST_VMD_SUBTYPE_REGISTER_69 (BOOST_VMD_TYPE_NUMBER,69) +#define BOOST_VMD_SUBTYPE_REGISTER_70 (BOOST_VMD_TYPE_NUMBER,70) +#define BOOST_VMD_SUBTYPE_REGISTER_71 (BOOST_VMD_TYPE_NUMBER,71) +#define BOOST_VMD_SUBTYPE_REGISTER_72 (BOOST_VMD_TYPE_NUMBER,72) +#define BOOST_VMD_SUBTYPE_REGISTER_73 (BOOST_VMD_TYPE_NUMBER,73) +#define BOOST_VMD_SUBTYPE_REGISTER_74 (BOOST_VMD_TYPE_NUMBER,74) +#define BOOST_VMD_SUBTYPE_REGISTER_75 (BOOST_VMD_TYPE_NUMBER,75) +#define BOOST_VMD_SUBTYPE_REGISTER_76 (BOOST_VMD_TYPE_NUMBER,76) +#define BOOST_VMD_SUBTYPE_REGISTER_77 (BOOST_VMD_TYPE_NUMBER,77) +#define BOOST_VMD_SUBTYPE_REGISTER_78 (BOOST_VMD_TYPE_NUMBER,78) +#define BOOST_VMD_SUBTYPE_REGISTER_79 (BOOST_VMD_TYPE_NUMBER,79) +#define BOOST_VMD_SUBTYPE_REGISTER_80 (BOOST_VMD_TYPE_NUMBER,80) +#define BOOST_VMD_SUBTYPE_REGISTER_81 (BOOST_VMD_TYPE_NUMBER,81) +#define BOOST_VMD_SUBTYPE_REGISTER_82 (BOOST_VMD_TYPE_NUMBER,82) +#define BOOST_VMD_SUBTYPE_REGISTER_83 (BOOST_VMD_TYPE_NUMBER,83) +#define BOOST_VMD_SUBTYPE_REGISTER_84 (BOOST_VMD_TYPE_NUMBER,84) +#define BOOST_VMD_SUBTYPE_REGISTER_85 (BOOST_VMD_TYPE_NUMBER,85) +#define BOOST_VMD_SUBTYPE_REGISTER_86 (BOOST_VMD_TYPE_NUMBER,86) +#define BOOST_VMD_SUBTYPE_REGISTER_87 (BOOST_VMD_TYPE_NUMBER,87) +#define BOOST_VMD_SUBTYPE_REGISTER_88 (BOOST_VMD_TYPE_NUMBER,88) +#define BOOST_VMD_SUBTYPE_REGISTER_89 (BOOST_VMD_TYPE_NUMBER,89) +#define BOOST_VMD_SUBTYPE_REGISTER_90 (BOOST_VMD_TYPE_NUMBER,90) +#define BOOST_VMD_SUBTYPE_REGISTER_91 (BOOST_VMD_TYPE_NUMBER,91) +#define BOOST_VMD_SUBTYPE_REGISTER_92 (BOOST_VMD_TYPE_NUMBER,92) +#define BOOST_VMD_SUBTYPE_REGISTER_93 (BOOST_VMD_TYPE_NUMBER,93) +#define BOOST_VMD_SUBTYPE_REGISTER_94 (BOOST_VMD_TYPE_NUMBER,94) +#define BOOST_VMD_SUBTYPE_REGISTER_95 (BOOST_VMD_TYPE_NUMBER,95) +#define BOOST_VMD_SUBTYPE_REGISTER_96 (BOOST_VMD_TYPE_NUMBER,96) +#define BOOST_VMD_SUBTYPE_REGISTER_97 (BOOST_VMD_TYPE_NUMBER,97) +#define BOOST_VMD_SUBTYPE_REGISTER_98 (BOOST_VMD_TYPE_NUMBER,98) +#define BOOST_VMD_SUBTYPE_REGISTER_99 (BOOST_VMD_TYPE_NUMBER,99) +#define BOOST_VMD_SUBTYPE_REGISTER_100 (BOOST_VMD_TYPE_NUMBER,100) +#define BOOST_VMD_SUBTYPE_REGISTER_101 (BOOST_VMD_TYPE_NUMBER,101) +#define BOOST_VMD_SUBTYPE_REGISTER_102 (BOOST_VMD_TYPE_NUMBER,102) +#define BOOST_VMD_SUBTYPE_REGISTER_103 (BOOST_VMD_TYPE_NUMBER,103) +#define BOOST_VMD_SUBTYPE_REGISTER_104 (BOOST_VMD_TYPE_NUMBER,104) +#define BOOST_VMD_SUBTYPE_REGISTER_105 (BOOST_VMD_TYPE_NUMBER,105) +#define BOOST_VMD_SUBTYPE_REGISTER_106 (BOOST_VMD_TYPE_NUMBER,106) +#define BOOST_VMD_SUBTYPE_REGISTER_107 (BOOST_VMD_TYPE_NUMBER,107) +#define BOOST_VMD_SUBTYPE_REGISTER_108 (BOOST_VMD_TYPE_NUMBER,108) +#define BOOST_VMD_SUBTYPE_REGISTER_109 (BOOST_VMD_TYPE_NUMBER,109) +#define BOOST_VMD_SUBTYPE_REGISTER_110 (BOOST_VMD_TYPE_NUMBER,110) +#define BOOST_VMD_SUBTYPE_REGISTER_111 (BOOST_VMD_TYPE_NUMBER,111) +#define BOOST_VMD_SUBTYPE_REGISTER_112 (BOOST_VMD_TYPE_NUMBER,112) +#define BOOST_VMD_SUBTYPE_REGISTER_113 (BOOST_VMD_TYPE_NUMBER,113) +#define BOOST_VMD_SUBTYPE_REGISTER_114 (BOOST_VMD_TYPE_NUMBER,114) +#define BOOST_VMD_SUBTYPE_REGISTER_115 (BOOST_VMD_TYPE_NUMBER,115) +#define BOOST_VMD_SUBTYPE_REGISTER_116 (BOOST_VMD_TYPE_NUMBER,116) +#define BOOST_VMD_SUBTYPE_REGISTER_117 (BOOST_VMD_TYPE_NUMBER,117) +#define BOOST_VMD_SUBTYPE_REGISTER_118 (BOOST_VMD_TYPE_NUMBER,118) +#define BOOST_VMD_SUBTYPE_REGISTER_119 (BOOST_VMD_TYPE_NUMBER,119) +#define BOOST_VMD_SUBTYPE_REGISTER_120 (BOOST_VMD_TYPE_NUMBER,120) +#define BOOST_VMD_SUBTYPE_REGISTER_121 (BOOST_VMD_TYPE_NUMBER,121) +#define BOOST_VMD_SUBTYPE_REGISTER_122 (BOOST_VMD_TYPE_NUMBER,122) +#define BOOST_VMD_SUBTYPE_REGISTER_123 (BOOST_VMD_TYPE_NUMBER,123) +#define BOOST_VMD_SUBTYPE_REGISTER_124 (BOOST_VMD_TYPE_NUMBER,124) +#define BOOST_VMD_SUBTYPE_REGISTER_125 (BOOST_VMD_TYPE_NUMBER,125) +#define BOOST_VMD_SUBTYPE_REGISTER_126 (BOOST_VMD_TYPE_NUMBER,126) +#define BOOST_VMD_SUBTYPE_REGISTER_127 (BOOST_VMD_TYPE_NUMBER,127) +#define BOOST_VMD_SUBTYPE_REGISTER_128 (BOOST_VMD_TYPE_NUMBER,128) +#define BOOST_VMD_SUBTYPE_REGISTER_129 (BOOST_VMD_TYPE_NUMBER,129) +#define BOOST_VMD_SUBTYPE_REGISTER_130 (BOOST_VMD_TYPE_NUMBER,130) +#define BOOST_VMD_SUBTYPE_REGISTER_131 (BOOST_VMD_TYPE_NUMBER,131) +#define BOOST_VMD_SUBTYPE_REGISTER_132 (BOOST_VMD_TYPE_NUMBER,132) +#define BOOST_VMD_SUBTYPE_REGISTER_133 (BOOST_VMD_TYPE_NUMBER,133) +#define BOOST_VMD_SUBTYPE_REGISTER_134 (BOOST_VMD_TYPE_NUMBER,134) +#define BOOST_VMD_SUBTYPE_REGISTER_135 (BOOST_VMD_TYPE_NUMBER,135) +#define BOOST_VMD_SUBTYPE_REGISTER_136 (BOOST_VMD_TYPE_NUMBER,136) +#define BOOST_VMD_SUBTYPE_REGISTER_137 (BOOST_VMD_TYPE_NUMBER,137) +#define BOOST_VMD_SUBTYPE_REGISTER_138 (BOOST_VMD_TYPE_NUMBER,138) +#define BOOST_VMD_SUBTYPE_REGISTER_139 (BOOST_VMD_TYPE_NUMBER,139) +#define BOOST_VMD_SUBTYPE_REGISTER_140 (BOOST_VMD_TYPE_NUMBER,140) +#define BOOST_VMD_SUBTYPE_REGISTER_141 (BOOST_VMD_TYPE_NUMBER,141) +#define BOOST_VMD_SUBTYPE_REGISTER_142 (BOOST_VMD_TYPE_NUMBER,142) +#define BOOST_VMD_SUBTYPE_REGISTER_143 (BOOST_VMD_TYPE_NUMBER,143) +#define BOOST_VMD_SUBTYPE_REGISTER_144 (BOOST_VMD_TYPE_NUMBER,144) +#define BOOST_VMD_SUBTYPE_REGISTER_145 (BOOST_VMD_TYPE_NUMBER,145) +#define BOOST_VMD_SUBTYPE_REGISTER_146 (BOOST_VMD_TYPE_NUMBER,146) +#define BOOST_VMD_SUBTYPE_REGISTER_147 (BOOST_VMD_TYPE_NUMBER,147) +#define BOOST_VMD_SUBTYPE_REGISTER_148 (BOOST_VMD_TYPE_NUMBER,148) +#define BOOST_VMD_SUBTYPE_REGISTER_149 (BOOST_VMD_TYPE_NUMBER,149) +#define BOOST_VMD_SUBTYPE_REGISTER_150 (BOOST_VMD_TYPE_NUMBER,150) +#define BOOST_VMD_SUBTYPE_REGISTER_151 (BOOST_VMD_TYPE_NUMBER,151) +#define BOOST_VMD_SUBTYPE_REGISTER_152 (BOOST_VMD_TYPE_NUMBER,152) +#define BOOST_VMD_SUBTYPE_REGISTER_153 (BOOST_VMD_TYPE_NUMBER,153) +#define BOOST_VMD_SUBTYPE_REGISTER_154 (BOOST_VMD_TYPE_NUMBER,154) +#define BOOST_VMD_SUBTYPE_REGISTER_155 (BOOST_VMD_TYPE_NUMBER,155) +#define BOOST_VMD_SUBTYPE_REGISTER_156 (BOOST_VMD_TYPE_NUMBER,156) +#define BOOST_VMD_SUBTYPE_REGISTER_157 (BOOST_VMD_TYPE_NUMBER,157) +#define BOOST_VMD_SUBTYPE_REGISTER_158 (BOOST_VMD_TYPE_NUMBER,158) +#define BOOST_VMD_SUBTYPE_REGISTER_159 (BOOST_VMD_TYPE_NUMBER,159) +#define BOOST_VMD_SUBTYPE_REGISTER_160 (BOOST_VMD_TYPE_NUMBER,160) +#define BOOST_VMD_SUBTYPE_REGISTER_161 (BOOST_VMD_TYPE_NUMBER,161) +#define BOOST_VMD_SUBTYPE_REGISTER_162 (BOOST_VMD_TYPE_NUMBER,162) +#define BOOST_VMD_SUBTYPE_REGISTER_163 (BOOST_VMD_TYPE_NUMBER,163) +#define BOOST_VMD_SUBTYPE_REGISTER_164 (BOOST_VMD_TYPE_NUMBER,164) +#define BOOST_VMD_SUBTYPE_REGISTER_165 (BOOST_VMD_TYPE_NUMBER,165) +#define BOOST_VMD_SUBTYPE_REGISTER_166 (BOOST_VMD_TYPE_NUMBER,166) +#define BOOST_VMD_SUBTYPE_REGISTER_167 (BOOST_VMD_TYPE_NUMBER,167) +#define BOOST_VMD_SUBTYPE_REGISTER_168 (BOOST_VMD_TYPE_NUMBER,168) +#define BOOST_VMD_SUBTYPE_REGISTER_169 (BOOST_VMD_TYPE_NUMBER,169) +#define BOOST_VMD_SUBTYPE_REGISTER_170 (BOOST_VMD_TYPE_NUMBER,170) +#define BOOST_VMD_SUBTYPE_REGISTER_171 (BOOST_VMD_TYPE_NUMBER,171) +#define BOOST_VMD_SUBTYPE_REGISTER_172 (BOOST_VMD_TYPE_NUMBER,172) +#define BOOST_VMD_SUBTYPE_REGISTER_173 (BOOST_VMD_TYPE_NUMBER,173) +#define BOOST_VMD_SUBTYPE_REGISTER_174 (BOOST_VMD_TYPE_NUMBER,174) +#define BOOST_VMD_SUBTYPE_REGISTER_175 (BOOST_VMD_TYPE_NUMBER,175) +#define BOOST_VMD_SUBTYPE_REGISTER_176 (BOOST_VMD_TYPE_NUMBER,176) +#define BOOST_VMD_SUBTYPE_REGISTER_177 (BOOST_VMD_TYPE_NUMBER,177) +#define BOOST_VMD_SUBTYPE_REGISTER_178 (BOOST_VMD_TYPE_NUMBER,178) +#define BOOST_VMD_SUBTYPE_REGISTER_179 (BOOST_VMD_TYPE_NUMBER,179) +#define BOOST_VMD_SUBTYPE_REGISTER_180 (BOOST_VMD_TYPE_NUMBER,180) +#define BOOST_VMD_SUBTYPE_REGISTER_181 (BOOST_VMD_TYPE_NUMBER,181) +#define BOOST_VMD_SUBTYPE_REGISTER_182 (BOOST_VMD_TYPE_NUMBER,182) +#define BOOST_VMD_SUBTYPE_REGISTER_183 (BOOST_VMD_TYPE_NUMBER,183) +#define BOOST_VMD_SUBTYPE_REGISTER_184 (BOOST_VMD_TYPE_NUMBER,184) +#define BOOST_VMD_SUBTYPE_REGISTER_185 (BOOST_VMD_TYPE_NUMBER,185) +#define BOOST_VMD_SUBTYPE_REGISTER_186 (BOOST_VMD_TYPE_NUMBER,186) +#define BOOST_VMD_SUBTYPE_REGISTER_187 (BOOST_VMD_TYPE_NUMBER,187) +#define BOOST_VMD_SUBTYPE_REGISTER_188 (BOOST_VMD_TYPE_NUMBER,188) +#define BOOST_VMD_SUBTYPE_REGISTER_189 (BOOST_VMD_TYPE_NUMBER,189) +#define BOOST_VMD_SUBTYPE_REGISTER_190 (BOOST_VMD_TYPE_NUMBER,190) +#define BOOST_VMD_SUBTYPE_REGISTER_191 (BOOST_VMD_TYPE_NUMBER,191) +#define BOOST_VMD_SUBTYPE_REGISTER_192 (BOOST_VMD_TYPE_NUMBER,192) +#define BOOST_VMD_SUBTYPE_REGISTER_193 (BOOST_VMD_TYPE_NUMBER,193) +#define BOOST_VMD_SUBTYPE_REGISTER_194 (BOOST_VMD_TYPE_NUMBER,194) +#define BOOST_VMD_SUBTYPE_REGISTER_195 (BOOST_VMD_TYPE_NUMBER,195) +#define BOOST_VMD_SUBTYPE_REGISTER_196 (BOOST_VMD_TYPE_NUMBER,196) +#define BOOST_VMD_SUBTYPE_REGISTER_197 (BOOST_VMD_TYPE_NUMBER,197) +#define BOOST_VMD_SUBTYPE_REGISTER_198 (BOOST_VMD_TYPE_NUMBER,198) +#define BOOST_VMD_SUBTYPE_REGISTER_199 (BOOST_VMD_TYPE_NUMBER,199) +#define BOOST_VMD_SUBTYPE_REGISTER_200 (BOOST_VMD_TYPE_NUMBER,200) +#define BOOST_VMD_SUBTYPE_REGISTER_201 (BOOST_VMD_TYPE_NUMBER,201) +#define BOOST_VMD_SUBTYPE_REGISTER_202 (BOOST_VMD_TYPE_NUMBER,202) +#define BOOST_VMD_SUBTYPE_REGISTER_203 (BOOST_VMD_TYPE_NUMBER,203) +#define BOOST_VMD_SUBTYPE_REGISTER_204 (BOOST_VMD_TYPE_NUMBER,204) +#define BOOST_VMD_SUBTYPE_REGISTER_205 (BOOST_VMD_TYPE_NUMBER,205) +#define BOOST_VMD_SUBTYPE_REGISTER_206 (BOOST_VMD_TYPE_NUMBER,206) +#define BOOST_VMD_SUBTYPE_REGISTER_207 (BOOST_VMD_TYPE_NUMBER,207) +#define BOOST_VMD_SUBTYPE_REGISTER_208 (BOOST_VMD_TYPE_NUMBER,208) +#define BOOST_VMD_SUBTYPE_REGISTER_209 (BOOST_VMD_TYPE_NUMBER,209) +#define BOOST_VMD_SUBTYPE_REGISTER_210 (BOOST_VMD_TYPE_NUMBER,210) +#define BOOST_VMD_SUBTYPE_REGISTER_211 (BOOST_VMD_TYPE_NUMBER,211) +#define BOOST_VMD_SUBTYPE_REGISTER_212 (BOOST_VMD_TYPE_NUMBER,212) +#define BOOST_VMD_SUBTYPE_REGISTER_213 (BOOST_VMD_TYPE_NUMBER,213) +#define BOOST_VMD_SUBTYPE_REGISTER_214 (BOOST_VMD_TYPE_NUMBER,214) +#define BOOST_VMD_SUBTYPE_REGISTER_215 (BOOST_VMD_TYPE_NUMBER,215) +#define BOOST_VMD_SUBTYPE_REGISTER_216 (BOOST_VMD_TYPE_NUMBER,216) +#define BOOST_VMD_SUBTYPE_REGISTER_217 (BOOST_VMD_TYPE_NUMBER,217) +#define BOOST_VMD_SUBTYPE_REGISTER_218 (BOOST_VMD_TYPE_NUMBER,218) +#define BOOST_VMD_SUBTYPE_REGISTER_219 (BOOST_VMD_TYPE_NUMBER,219) +#define BOOST_VMD_SUBTYPE_REGISTER_220 (BOOST_VMD_TYPE_NUMBER,220) +#define BOOST_VMD_SUBTYPE_REGISTER_221 (BOOST_VMD_TYPE_NUMBER,221) +#define BOOST_VMD_SUBTYPE_REGISTER_222 (BOOST_VMD_TYPE_NUMBER,222) +#define BOOST_VMD_SUBTYPE_REGISTER_223 (BOOST_VMD_TYPE_NUMBER,223) +#define BOOST_VMD_SUBTYPE_REGISTER_224 (BOOST_VMD_TYPE_NUMBER,224) +#define BOOST_VMD_SUBTYPE_REGISTER_225 (BOOST_VMD_TYPE_NUMBER,225) +#define BOOST_VMD_SUBTYPE_REGISTER_226 (BOOST_VMD_TYPE_NUMBER,226) +#define BOOST_VMD_SUBTYPE_REGISTER_227 (BOOST_VMD_TYPE_NUMBER,227) +#define BOOST_VMD_SUBTYPE_REGISTER_228 (BOOST_VMD_TYPE_NUMBER,228) +#define BOOST_VMD_SUBTYPE_REGISTER_229 (BOOST_VMD_TYPE_NUMBER,229) +#define BOOST_VMD_SUBTYPE_REGISTER_230 (BOOST_VMD_TYPE_NUMBER,230) +#define BOOST_VMD_SUBTYPE_REGISTER_231 (BOOST_VMD_TYPE_NUMBER,231) +#define BOOST_VMD_SUBTYPE_REGISTER_232 (BOOST_VMD_TYPE_NUMBER,232) +#define BOOST_VMD_SUBTYPE_REGISTER_233 (BOOST_VMD_TYPE_NUMBER,233) +#define BOOST_VMD_SUBTYPE_REGISTER_234 (BOOST_VMD_TYPE_NUMBER,234) +#define BOOST_VMD_SUBTYPE_REGISTER_235 (BOOST_VMD_TYPE_NUMBER,235) +#define BOOST_VMD_SUBTYPE_REGISTER_236 (BOOST_VMD_TYPE_NUMBER,236) +#define BOOST_VMD_SUBTYPE_REGISTER_237 (BOOST_VMD_TYPE_NUMBER,237) +#define BOOST_VMD_SUBTYPE_REGISTER_238 (BOOST_VMD_TYPE_NUMBER,238) +#define BOOST_VMD_SUBTYPE_REGISTER_239 (BOOST_VMD_TYPE_NUMBER,239) +#define BOOST_VMD_SUBTYPE_REGISTER_240 (BOOST_VMD_TYPE_NUMBER,240) +#define BOOST_VMD_SUBTYPE_REGISTER_241 (BOOST_VMD_TYPE_NUMBER,241) +#define BOOST_VMD_SUBTYPE_REGISTER_242 (BOOST_VMD_TYPE_NUMBER,242) +#define BOOST_VMD_SUBTYPE_REGISTER_243 (BOOST_VMD_TYPE_NUMBER,243) +#define BOOST_VMD_SUBTYPE_REGISTER_244 (BOOST_VMD_TYPE_NUMBER,244) +#define BOOST_VMD_SUBTYPE_REGISTER_245 (BOOST_VMD_TYPE_NUMBER,245) +#define BOOST_VMD_SUBTYPE_REGISTER_246 (BOOST_VMD_TYPE_NUMBER,246) +#define BOOST_VMD_SUBTYPE_REGISTER_247 (BOOST_VMD_TYPE_NUMBER,247) +#define BOOST_VMD_SUBTYPE_REGISTER_248 (BOOST_VMD_TYPE_NUMBER,248) +#define BOOST_VMD_SUBTYPE_REGISTER_249 (BOOST_VMD_TYPE_NUMBER,249) +#define BOOST_VMD_SUBTYPE_REGISTER_250 (BOOST_VMD_TYPE_NUMBER,250) +#define BOOST_VMD_SUBTYPE_REGISTER_251 (BOOST_VMD_TYPE_NUMBER,251) +#define BOOST_VMD_SUBTYPE_REGISTER_252 (BOOST_VMD_TYPE_NUMBER,252) +#define BOOST_VMD_SUBTYPE_REGISTER_253 (BOOST_VMD_TYPE_NUMBER,253) +#define BOOST_VMD_SUBTYPE_REGISTER_254 (BOOST_VMD_TYPE_NUMBER,254) +#define BOOST_VMD_SUBTYPE_REGISTER_255 (BOOST_VMD_TYPE_NUMBER,255) +#define BOOST_VMD_SUBTYPE_REGISTER_256 (BOOST_VMD_TYPE_NUMBER,256) + +#endif /* BOOST_VMD_DETAIL_IS_NUMBER_REGISTRATION_HPP */ diff --git a/boost/vmd/detail/only_after.hpp b/boost/vmd/detail/only_after.hpp new file mode 100644 index 0000000000..c00d60c400 --- /dev/null +++ b/boost/vmd/detail/only_after.hpp @@ -0,0 +1,37 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_ONLY_AFTER_HPP) +#define BOOST_VMD_DETAIL_ONLY_AFTER_HPP + +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/modifiers.hpp> + +/* + + Determines whether or not the BOOST_VMD_RETURN_ONLY_AFTER modifiers has been passed + as a variadic parameter. + + Returns 1 = BOOST_VMD_RETURN_ONLY_AFTER has been passed + 0 = BOOST_VMD_RETURN_ONLY_AFTER has not been passed + +*/ + +#define BOOST_VMD_DETAIL_ONLY_AFTER(...) \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_ONLY_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_ONLY_AFTER_D(d,...) \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_ONLY_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_ONLY_AFTER_HPP */ diff --git a/boost/vmd/detail/parens.hpp b/boost/vmd/detail/parens.hpp new file mode 100644 index 0000000000..669b136d77 --- /dev/null +++ b/boost/vmd/detail/parens.hpp @@ -0,0 +1,54 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_PARENS_HPP) +#define BOOST_VMD_DETAIL_PARENS_HPP + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/parens_split.hpp> +#include <boost/vmd/detail/parens_common.hpp> + +#define BOOST_VMD_DETAIL_PARENS_PROCESS(vseq) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(vseq), \ + BOOST_VMD_DETAIL_BEGIN_PARENS, \ + BOOST_VMD_EMPTY \ + ) \ + (vseq) \ +/**/ + +#define BOOST_VMD_DETAIL_PARENS(...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ), \ + BOOST_VMD_DETAIL_PARENS_SPLIT, \ + BOOST_VMD_DETAIL_PARENS_PROCESS \ + ) \ + (BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#define BOOST_VMD_DETAIL_PARENS_D(d,...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ), \ + BOOST_VMD_DETAIL_PARENS_SPLIT, \ + BOOST_VMD_DETAIL_PARENS_PROCESS \ + ) \ + (BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_PARENS_HPP */ diff --git a/boost/vmd/detail/parens_common.hpp b/boost/vmd/detail/parens_common.hpp new file mode 100644 index 0000000000..3a323ed432 --- /dev/null +++ b/boost/vmd/detail/parens_common.hpp @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_PARENS_COMMON_HPP) +#define BOOST_VMD_DETAIL_PARENS_COMMON_HPP + +#include <boost/preprocessor/facilities/expand.hpp> +#include <boost/preprocessor/punctuation/paren.hpp> +#include <boost/vmd/empty.hpp> + +#define BOOST_VMD_DETAIL_BEGIN_PARENS_EXP2(...) ( __VA_ARGS__ ) BOOST_VMD_EMPTY BOOST_PP_LPAREN() +#define BOOST_VMD_DETAIL_BEGIN_PARENS_EXP1(vseq) BOOST_VMD_DETAIL_BEGIN_PARENS_EXP2 vseq BOOST_PP_RPAREN() +#define BOOST_VMD_DETAIL_BEGIN_PARENS(vseq) BOOST_PP_EXPAND(BOOST_VMD_DETAIL_BEGIN_PARENS_EXP1(vseq)) + +#define BOOST_VMD_DETAIL_AFTER_PARENS_DATA(vseq) BOOST_VMD_EMPTY vseq +#define BOOST_VMD_DETAIL_SPLIT_PARENS(vseq) (BOOST_VMD_DETAIL_BEGIN_PARENS(vseq),BOOST_VMD_DETAIL_AFTER_PARENS_DATA(vseq)) + +#endif /* BOOST_VMD_DETAIL_PARENS_COMMON_HPP */ diff --git a/boost/vmd/detail/parens_split.hpp b/boost/vmd/detail/parens_split.hpp new file mode 100644 index 0000000000..ed90cdf4c6 --- /dev/null +++ b/boost/vmd/detail/parens_split.hpp @@ -0,0 +1,24 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_PARENS_SPLIT_HPP) +#define BOOST_VMD_DETAIL_PARENS_SPLIT_HPP + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/vmd/detail/empty_result.hpp> +#include <boost/vmd/detail/parens_common.hpp> + +#define BOOST_VMD_DETAIL_PARENS_SPLIT(vseq) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(vseq), \ + BOOST_VMD_DETAIL_SPLIT_PARENS, \ + BOOST_VMD_DETAIL_EMPTY_RESULT \ + ) \ + (vseq) \ +/**/ +#endif /* BOOST_VMD_DETAIL_PARENS_SPLIT_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_1.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_1.hpp new file mode 100644 index 0000000000..3ff4c11227 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_1.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_1_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_1_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_1_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_10.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_10.hpp new file mode 100644 index 0000000000..3c36ea94d6 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_10.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_10_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_10_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_10_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_11.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_11.hpp new file mode 100644 index 0000000000..b5a8fabde7 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_11.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_11_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_11_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_11_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_12.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_12.hpp new file mode 100644 index 0000000000..12872c95e8 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_12.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_12_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_12_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_12_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_13.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_13.hpp new file mode 100644 index 0000000000..d92f95aeb4 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_13.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_13_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_13_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_13_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_14.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_14.hpp new file mode 100644 index 0000000000..9133718f98 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_14.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_14_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_14_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_14_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_15.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_15.hpp new file mode 100644 index 0000000000..21cbb00b69 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_15.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_15_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_15_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_15_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_16.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_16.hpp new file mode 100644 index 0000000000..4ae286ef4d --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_16.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_16_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_16_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_16_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_2.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_2.hpp new file mode 100644 index 0000000000..4fa02f5e73 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_2.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_2_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_2_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_2_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_3.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_3.hpp new file mode 100644 index 0000000000..35ae21f021 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_3.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_3_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_3_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_3_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_4.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_4.hpp new file mode 100644 index 0000000000..c08e3071b7 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_4.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_4_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_4_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_4_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_5.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_5.hpp new file mode 100644 index 0000000000..bcf11038f3 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_5.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_5_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_5_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_5_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_6.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_6.hpp new file mode 100644 index 0000000000..ea4d826066 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_6.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_6_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_6_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_6_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_7.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_7.hpp new file mode 100644 index 0000000000..36e141cee7 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_7.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_7_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_7_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_7_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_8.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_8.hpp new file mode 100644 index 0000000000..612f6d7b30 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_8.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_8_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_8_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_8_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_9.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_9.hpp new file mode 100644 index 0000000000..e7853f42b0 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_9.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_9_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_9_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_9_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp new file mode 100644 index 0000000000..19796a4c69 --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp @@ -0,0 +1,22 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_HEADERS_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_HEADERS_HPP + +#include <boost/preprocessor/array/size.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/control/while.hpp> +#include <boost/preprocessor/list/size.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/detail/data_equal_common.hpp> + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_HEADERS_HPP */ diff --git a/boost/vmd/detail/recurse/data_equal/data_equal_specific.hpp b/boost/vmd/detail/recurse/data_equal/data_equal_specific.hpp new file mode 100644 index 0000000000..d0169899bf --- /dev/null +++ b/boost/vmd/detail/recurse/data_equal/data_equal_specific.hpp @@ -0,0 +1,185 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_HPP) +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_HPP + +#include <boost/vmd/detail/recurse/data_equal/data_equal_headers.hpp> + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ_CMP_PARENS(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ_CMP_PARENS_D(d,em1,em2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_IS_BOTH_COMPOSITE(em1,em2), \ + BOOST_VMD_IDENTITY(2), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D \ + ) \ + (d,em1,em2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ_CMP(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ_CMP_PARENS \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ_CMP_D(d,state,em1,em2) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_COMP_PROCESSING(d,state), \ + BOOST_VMD_DETAIL_EQUAL_SIMPLE_D, \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ_CMP_PARENS_D \ + ) \ + (d,em1,em2) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ_CMP \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ_CMP_D \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_FIRST_ELEMENT(d,state), \ + BOOST_VMD_DETAIL_DATA_EQUAL_STATE_GET_SECOND_ELEMENT(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_D(d,state) \ + BOOST_VMD_DETAIL_DATA_EQUAL_OP_RESULT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_TEQ_D(d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_LOOP(dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_LOOP_D(d,dataf,datas,sz,vtype) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_DATA_EQUAL_PRED, \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_OP_D, \ + ( \ + 1, \ + dataf, \ + datas, \ + sz, \ + vtype, \ + 0, \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_SZ(dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_LOOP, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_SZ_D(d,dataf,datas,szf,szs,vtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,szf,szs), \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_LOOP_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,dataf,datas,szf,vtype) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC(dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_SZ \ + ( \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE(datas,vtype), \ + vtype \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_D(d,dataf,datas,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_SZ_D \ + ( \ + d, \ + dataf, \ + datas, \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,dataf,vtype), \ + BOOST_VMD_DETAIL_DATA_EQUAL_GET_SIZE_D(d,datas,vtype), \ + vtype \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_DATA_EQUAL_SPECIFIC_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_1.hpp b/boost/vmd/detail/recurse/equal/equal_1.hpp new file mode 100644 index 0000000000..26e9a25137 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_1.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_1_HPP) +#define BOOST_VMD_DETAIL_EQUAL_1_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_1_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_1, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_1 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_1_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_1_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_1_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_1_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_1_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_1_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_1_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_1_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_1_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_1_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_1_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_1_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_1_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_1_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_1_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_1_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_1_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_1_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_1_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_1_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_1_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_10.hpp b/boost/vmd/detail/recurse/equal/equal_10.hpp new file mode 100644 index 0000000000..77c832ee09 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_10.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_10_HPP) +#define BOOST_VMD_DETAIL_EQUAL_10_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_10_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_10, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_10 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_10_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_10_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_10_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_10_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_10_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_10_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_10_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_10_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_10_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_10_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_10_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_10_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_10_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_10_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_10_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_10_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_10_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_10_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_10_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_10_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_10_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_11.hpp b/boost/vmd/detail/recurse/equal/equal_11.hpp new file mode 100644 index 0000000000..96add5fc82 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_11.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_11_HPP) +#define BOOST_VMD_DETAIL_EQUAL_11_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_11_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_11, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_11 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_11_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_11_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_11_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_11_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_11_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_11_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_11_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_11_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_11_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_11_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_11_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_11_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_11_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_11_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_11_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_11_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_11_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_11_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_11_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_11_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_11_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_12.hpp b/boost/vmd/detail/recurse/equal/equal_12.hpp new file mode 100644 index 0000000000..d3fa1c8e80 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_12.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_12_HPP) +#define BOOST_VMD_DETAIL_EQUAL_12_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_12_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_12, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_12 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_12_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_12_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_12_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_12_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_12_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_12_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_12_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_12_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_12_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_12_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_12_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_12_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_12_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_12_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_12_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_12_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_12_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_12_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_12_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_12_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_12_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_13.hpp b/boost/vmd/detail/recurse/equal/equal_13.hpp new file mode 100644 index 0000000000..8dfa0ff1c7 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_13.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_13_HPP) +#define BOOST_VMD_DETAIL_EQUAL_13_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_13_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_13, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_13 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_13_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_13_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_13_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_13_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_13_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_13_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_13_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_13_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_13_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_13_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_13_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_13_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_13_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_13_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_13_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_13_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_13_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_13_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_13_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_13_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_13_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_14.hpp b/boost/vmd/detail/recurse/equal/equal_14.hpp new file mode 100644 index 0000000000..9e6c444a84 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_14.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_14_HPP) +#define BOOST_VMD_DETAIL_EQUAL_14_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_14_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_14, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_14 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_14_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_14_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_14_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_14_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_14_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_14_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_14_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_14_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_14_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_14_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_14_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_14_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_14_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_14_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_14_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_14_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_14_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_14_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_14_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_14_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_14_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_15.hpp b/boost/vmd/detail/recurse/equal/equal_15.hpp new file mode 100644 index 0000000000..f6a733c176 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_15.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_15_HPP) +#define BOOST_VMD_DETAIL_EQUAL_15_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_15_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_15, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_15 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_15_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_15_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_15_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_15_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_15_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_15_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_15_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_15_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_15_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_15_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_15_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_15_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_15_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_15_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_15_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_15_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_15_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_15_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_15_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_15_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_15_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_16.hpp b/boost/vmd/detail/recurse/equal/equal_16.hpp new file mode 100644 index 0000000000..031105e55f --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_16.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_16_HPP) +#define BOOST_VMD_DETAIL_EQUAL_16_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_16_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_16, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_16 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_16_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_16_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_16_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_16_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_16_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_16_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_16_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_16_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_16_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_16_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_16_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_16_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_16_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_16_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_16_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_16_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_16_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_16_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_16_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_16_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_16_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_2.hpp b/boost/vmd/detail/recurse/equal/equal_2.hpp new file mode 100644 index 0000000000..0b2cadb1d0 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_2.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_2_HPP) +#define BOOST_VMD_DETAIL_EQUAL_2_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_2_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_2, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_2 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_2_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_2_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_2_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_2_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_2_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_2_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_2_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_2_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_2_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_2_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_2_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_2_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_2_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_2_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_2_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_2_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_2_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_2_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_2_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_2_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_2_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_3.hpp b/boost/vmd/detail/recurse/equal/equal_3.hpp new file mode 100644 index 0000000000..6f4e6241f5 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_3.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_3_HPP) +#define BOOST_VMD_DETAIL_EQUAL_3_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_3_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_3, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_3 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_3_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_3_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_3_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_3_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_3_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_3_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_3_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_3_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_3_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_3_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_3_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_3_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_3_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_3_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_3_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_3_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_3_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_3_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_3_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_3_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_3_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_4.hpp b/boost/vmd/detail/recurse/equal/equal_4.hpp new file mode 100644 index 0000000000..aa5d438e5a --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_4.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_4_HPP) +#define BOOST_VMD_DETAIL_EQUAL_4_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_4_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_4, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_4 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_4_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_4_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_4_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_4_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_4_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_4_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_4_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_4_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_4_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_4_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_4_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_4_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_4_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_4_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_4_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_4_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_4_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_4_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_4_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_4_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_4_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_5.hpp b/boost/vmd/detail/recurse/equal/equal_5.hpp new file mode 100644 index 0000000000..ab580b8b07 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_5.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_5_HPP) +#define BOOST_VMD_DETAIL_EQUAL_5_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_5_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_5, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_5 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_5_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_5_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_5_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_5_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_5_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_5_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_5_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_5_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_5_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_5_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_5_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_5_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_5_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_5_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_5_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_5_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_5_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_5_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_5_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_5_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_5_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_6.hpp b/boost/vmd/detail/recurse/equal/equal_6.hpp new file mode 100644 index 0000000000..85212c005f --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_6.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_6_HPP) +#define BOOST_VMD_DETAIL_EQUAL_6_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_6_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_6, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_6 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_6_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_6_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_6_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_6_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_6_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_6_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_6_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_6_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_6_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_6_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_6_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_6_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_6_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_6_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_6_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_6_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_6_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_6_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_6_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_6_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_6_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_7.hpp b/boost/vmd/detail/recurse/equal/equal_7.hpp new file mode 100644 index 0000000000..6ce81630c9 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_7.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_7_HPP) +#define BOOST_VMD_DETAIL_EQUAL_7_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_7_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_7, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_7 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_7_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_7_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_7_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_7_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_7_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_7_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_7_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_7_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_7_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_7_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_7_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_7_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_7_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_7_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_7_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_7_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_7_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_7_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_7_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_7_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_7_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_8.hpp b/boost/vmd/detail/recurse/equal/equal_8.hpp new file mode 100644 index 0000000000..bedee9c50a --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_8.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_8_HPP) +#define BOOST_VMD_DETAIL_EQUAL_8_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_8_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_8, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_8 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_8_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_8_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_8_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_8_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_8_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_8_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_8_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_8_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_8_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_8_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_8_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_8_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_8_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_8_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_8_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_8_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_8_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_8_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_8_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_8_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_8_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_9.hpp b/boost/vmd/detail/recurse/equal/equal_9.hpp new file mode 100644 index 0000000000..bf91c229ef --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_9.hpp @@ -0,0 +1,282 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_9_HPP) +#define BOOST_VMD_DETAIL_EQUAL_9_HPP + +#include <boost/vmd/detail/recurse/equal/equal_headers.hpp> + +#define BOOST_VMD_DETAIL_EQUAL_9_CNI_CHK(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_9, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_CNI_CHK_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_ARRAY), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_LIST) \ + ), \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,vtype,BOOST_VMD_TYPE_TUPLE) \ + ) \ + ), \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_D, \ + BOOST_VMD_DETAIL_EQUAL_CNI_SMP_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_VSEQ(vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_9 \ + ( \ + BOOST_VMD_TO_SEQ(vseq1), \ + BOOST_VMD_TO_SEQ(vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_VSEQ_D(d,vseq1,vseq2,vtype) \ + BOOST_VMD_DETAIL_DATA_EQUAL_9_D \ + ( \ + d, \ + BOOST_VMD_TO_SEQ_D(d,vseq1), \ + BOOST_VMD_TO_SEQ_D(d,vseq2), \ + BOOST_VMD_TYPE_SEQ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_CNI(vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_9_VSEQ, \ + BOOST_VMD_DETAIL_EQUAL_9_CNI_CHK \ + ) \ + (vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_CNI_D(d,vseq1,vseq2,vtype) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype, \ + BOOST_VMD_TYPE_SEQUENCE \ + ), \ + BOOST_VMD_DETAIL_EQUAL_9_VSEQ_D, \ + BOOST_VMD_DETAIL_EQUAL_9_CNI_CHK_D \ + ) \ + (d,vseq1,vseq2,vtype) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_WT_CHECK(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_9_CNI, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_WT_CHECK_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + vtype1, \ + vtype2 \ + ), \ + BOOST_VMD_DETAIL_EQUAL_9_CNI_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2,vtype1) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_WT_CONVERT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_9_WT_CHECK \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_WT_CONVERT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_DETAIL_EQUAL_9_WT_CHECK_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq1,vtype1), \ + BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,vseq2,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_WT(vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH(vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_9_WT_CONVERT \ + ) \ + (vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_WT_D(d,vseq1,vseq2,vtype1,vtype2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_IS_TUPLE_MISMATCH_D(d,vseq1,vseq2,vtype1,vtype2), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_EQUAL_9_WT_CONVERT_D \ + ) \ + (d,vseq1,vseq2,vtype1,vtype2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_GTYPE(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_9_WT \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE(vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE(vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_GTYPE_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_9_WT_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_GET_TYPE_D(d,vseq1,BOOST_VMD_RETURN_TYPE_TUPLE), \ + BOOST_VMD_GET_TYPE_D(d,vseq2,BOOST_VMD_RETURN_TYPE_TUPLE) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_EBP(vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_9_GTYPE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_EBP_D(d,vseq1,vseq2,be1,be2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_CHK_MATCH(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_CHK_PARENS_MATCH(vseq1,vseq2) \ + ), \ + BOOST_VMD_DETAIL_EQUAL_9_GTYPE_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq1,vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_EMPTY(vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_9_EBP \ + ) \ + (vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_EMPTY_D(d,vseq1,vseq2,be1,be2) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND(be1,be2), \ + BOOST_VMD_DETAIL_EQUAL_BOTH_EMPTY, \ + BOOST_VMD_DETAIL_EQUAL_9_EBP_D \ + ) \ + (d,vseq1,vseq2,be1,be2) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9(vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_9_EMPTY \ + ( \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_EQUAL_9_D(d,vseq1,vseq2) \ + BOOST_VMD_DETAIL_EQUAL_9_EMPTY_D \ + ( \ + d, \ + vseq1, \ + vseq2, \ + BOOST_VMD_IS_EMPTY(vseq1), \ + BOOST_VMD_IS_EMPTY(vseq2) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_EQUAL_9_HPP */ diff --git a/boost/vmd/detail/recurse/equal/equal_headers.hpp b/boost/vmd/detail/recurse/equal/equal_headers.hpp new file mode 100644 index 0000000000..7b15cbe533 --- /dev/null +++ b/boost/vmd/detail/recurse/equal/equal_headers.hpp @@ -0,0 +1,23 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_EQUAL_HEADERS_HPP) +#define BOOST_VMD_DETAIL_EQUAL_HEADERS_HPP + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/logical/bitor.hpp> +#include <boost/preprocessor/logical/bitand.hpp> +#include <boost/vmd/to_seq.hpp> +#include <boost/vmd/get_type.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/adjust_tuple_type.hpp> +#include <boost/vmd/detail/data_equal.hpp> +#include <boost/vmd/detail/equal_common.hpp> +#include <boost/vmd/detail/equal_type.hpp> +#include <boost/vmd/detail/modifiers.hpp> + +#endif /* BOOST_VMD_DETAIL_EQUAL_HEADERS_HPP */ diff --git a/boost/vmd/detail/seq.hpp b/boost/vmd/detail/seq.hpp new file mode 100644 index 0000000000..5021f76147 --- /dev/null +++ b/boost/vmd/detail/seq.hpp @@ -0,0 +1,236 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SEQ_HPP) +#define BOOST_VMD_DETAIL_SEQ_HPP + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/control/while.hpp> +#include <boost/preprocessor/facilities/empty.hpp> +#include <boost/preprocessor/seq/push_back.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/push_back.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/empty_result.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/not_empty.hpp> +#include <boost/vmd/detail/parens.hpp> + +#define BOOST_VMD_DETAIL_SEQ_STATE_INIT(seq) \ + BOOST_PP_TUPLE_PUSH_BACK \ + ( \ + BOOST_PP_TUPLE_PUSH_BACK \ + ( \ + BOOST_VMD_DETAIL_PARENS(seq,BOOST_VMD_RETURN_AFTER), \ + BOOST_PP_EMPTY() \ + ), \ + BOOST_PP_EMPTY() \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_STATE_INIT_D(d,seq) \ + BOOST_PP_TUPLE_PUSH_BACK \ + ( \ + BOOST_PP_TUPLE_PUSH_BACK \ + ( \ + BOOST_VMD_DETAIL_PARENS_D(d,seq,BOOST_VMD_RETURN_AFTER), \ + BOOST_PP_EMPTY() \ + ), \ + BOOST_PP_EMPTY() \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_STATE_PRED(d,state) \ + BOOST_VMD_DETAIL_NOT_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM(0,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_STATE_OP_SET_FAILURE(d,state) \ + ( \ + BOOST_PP_EMPTY(), \ + BOOST_PP_EMPTY(), \ + BOOST_PP_TUPLE_ELEM(2,state), \ + BOOST_PP_TUPLE_ELEM(3,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_STATE_OP_MAKE_SEQ(d,state) \ + BOOST_PP_TUPLE_ELEM(0,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_STATE_OP_UPGRADE_SEQ(d,state) \ + BOOST_PP_SEQ_PUSH_BACK \ + ( \ + BOOST_PP_TUPLE_ELEM(2,state), \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_TUPLE_ELEM(0,state) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_STATE_OP_SET_SUCCESS(d,state) \ + ( \ + BOOST_PP_EMPTY(), \ + BOOST_PP_EMPTY(), \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM(2,state) \ + ), \ + BOOST_VMD_DETAIL_SEQ_STATE_OP_MAKE_SEQ, \ + BOOST_VMD_DETAIL_SEQ_STATE_OP_UPGRADE_SEQ \ + ) \ + (d,state), \ + BOOST_PP_EMPTY() \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_STATE_OP_SET_CONTINUE(d,state) \ + BOOST_PP_TUPLE_PUSH_BACK \ + ( \ + BOOST_PP_TUPLE_PUSH_BACK \ + ( \ + BOOST_VMD_DETAIL_PARENS_D(d,BOOST_PP_TUPLE_ELEM(1,state),BOOST_VMD_RETURN_AFTER), \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM(2,state) \ + ), \ + BOOST_VMD_DETAIL_SEQ_STATE_OP_MAKE_SEQ, \ + BOOST_VMD_DETAIL_SEQ_STATE_OP_UPGRADE_SEQ \ + ) \ + (d,state) \ + ), \ + BOOST_PP_TUPLE_ELEM(1,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_STATE_OP_CHECK_REST(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM(1,state) \ + ), \ + BOOST_VMD_DETAIL_SEQ_STATE_OP_SET_SUCCESS, \ + BOOST_VMD_DETAIL_SEQ_STATE_OP_SET_CONTINUE \ + ) \ + (d,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_STATE_OP(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D \ + ( \ + d, \ + 1, \ + BOOST_PP_TUPLE_SIZE \ + ( \ + BOOST_PP_TUPLE_ELEM(0,state) \ + ) \ + ), \ + BOOST_VMD_DETAIL_SEQ_STATE_OP_CHECK_REST, \ + BOOST_VMD_DETAIL_SEQ_STATE_OP_SET_FAILURE \ + ) \ + (d,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_STATE_RESULT(state) \ + ( \ + BOOST_PP_TUPLE_ELEM(2,state), \ + BOOST_PP_TUPLE_ELEM(3,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_PROCESS(seq) \ + BOOST_VMD_DETAIL_SEQ_STATE_RESULT \ + ( \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_SEQ_STATE_PRED, \ + BOOST_VMD_DETAIL_SEQ_STATE_OP, \ + BOOST_VMD_DETAIL_SEQ_STATE_INIT(seq) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_SPLIT(seq) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(seq), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_SEQ_PROCESS \ + ) \ + (seq) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_BEGIN(seq) \ + BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_DETAIL_SEQ_SPLIT(seq)) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_PROCESS_D(d,seq) \ + BOOST_VMD_DETAIL_SEQ_STATE_RESULT \ + ( \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_SEQ_STATE_PRED, \ + BOOST_VMD_DETAIL_SEQ_STATE_OP, \ + BOOST_VMD_DETAIL_SEQ_STATE_INIT_D(d,seq) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_SPLIT_D(d,seq) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(seq), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_SEQ_PROCESS_D \ + ) \ + (d,seq) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_BEGIN_D(d,seq) \ + BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_DETAIL_SEQ_SPLIT_D(d,seq)) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ_D(d,...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ), \ + BOOST_VMD_DETAIL_SEQ_SPLIT_D, \ + BOOST_VMD_DETAIL_SEQ_BEGIN_D \ + ) \ + (d,BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQ(...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ), \ + BOOST_VMD_DETAIL_SEQ_SPLIT, \ + BOOST_VMD_DETAIL_SEQ_BEGIN \ + ) \ + (BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_SEQ_HPP */ diff --git a/boost/vmd/detail/sequence_arity.hpp b/boost/vmd/detail/sequence_arity.hpp new file mode 100644 index 0000000000..14a8ad04ad --- /dev/null +++ b/boost/vmd/detail/sequence_arity.hpp @@ -0,0 +1,66 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SEQUENCE_ARITY_HPP) +#define BOOST_VMD_DETAIL_SEQUENCE_ARITY_HPP + +#include <boost/preprocessor/logical/bitand.hpp> +#include <boost/preprocessor/logical/bitnor.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/modifiers.hpp> +#include <boost/vmd/detail/not_empty.hpp> +#include <boost/vmd/detail/sequence_elem.hpp> + +#define BOOST_VMD_DETAIL_IS_MULTI_TUPLE(tuple) \ + BOOST_PP_BITNOR \ + ( \ + BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,tuple)), \ + BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,tuple)) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_UNARY_TUPLE(tuple) \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_PP_TUPLE_ELEM(0,tuple)), \ + BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,tuple)) \ + ) \ +/**/ + +// UNARY + +#define BOOST_VMD_DETAIL_IS_UNARY(vseq) \ + BOOST_VMD_DETAIL_IS_UNARY_TUPLE \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM(BOOST_VMD_ALLOW_AFTER,0,vseq,BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_UNARY_D(d,vseq) \ + BOOST_VMD_DETAIL_IS_UNARY_TUPLE \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_D(d,BOOST_VMD_ALLOW_AFTER,0,vseq,BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +// MULTI + +#define BOOST_VMD_DETAIL_IS_MULTI(vseq) \ + BOOST_VMD_DETAIL_IS_MULTI_TUPLE \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM(BOOST_VMD_ALLOW_AFTER,0,vseq,BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_IS_MULTI_D(d,vseq) \ + BOOST_VMD_DETAIL_IS_MULTI_TUPLE \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_D(d,BOOST_VMD_ALLOW_AFTER,0,vseq,BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_SEQUENCE_ARITY_HPP */ diff --git a/boost/vmd/detail/sequence_common.hpp b/boost/vmd/detail/sequence_common.hpp new file mode 100644 index 0000000000..62a925b8bc --- /dev/null +++ b/boost/vmd/detail/sequence_common.hpp @@ -0,0 +1,766 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SEQUENCE_COMMON_HPP) +#define BOOST_VMD_DETAIL_SEQUENCE_COMMON_HPP + +#include <boost/preprocessor/arithmetic/inc.hpp> +#include <boost/preprocessor/array/push_back.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/comparison/less_equal.hpp> +#include <boost/preprocessor/comparison/not_equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/control/while.hpp> +#include <boost/preprocessor/list/append.hpp> +#include <boost/preprocessor/logical/bitor.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/seq/push_back.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/push_back.hpp> +#include <boost/preprocessor/tuple/replace.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_empty_list.hpp> +#include <boost/vmd/detail/array.hpp> +#include <boost/vmd/detail/equal_type.hpp> +#include <boost/vmd/detail/identifier.hpp> +#include <boost/vmd/detail/identifier_type.hpp> +#include <boost/vmd/detail/list.hpp> +#include <boost/vmd/detail/modifiers.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/seq.hpp> +#include <boost/vmd/detail/tuple.hpp> + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT_ELEM 0 +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ELEM 1 +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM_ELEM 2 +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_OUTTYPE_ELEM 3 +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_FROM_ELEM 4 +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_TYPES_ELEM 5 +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_INDEX_ELEM 6 + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT_ELEM,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ELEM,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM_ELEM,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_OUTTYPE(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_SEQUENCE_STATE_OUTTYPE_ELEM,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_FROM(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_SEQUENCE_STATE_FROM_ELEM,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_RETURN(d,from,number) \ + BOOST_PP_EQUAL_D \ + ( \ + d, \ + BOOST_PP_TUPLE_ELEM(0,from), \ + number \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_NO_RETURN(d,from) \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_RETURN(d,from,BOOST_VMD_DETAIL_MODS_NO_RETURN) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_EXACT_RETURN(d,from) \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_RETURN(d,from,BOOST_VMD_DETAIL_MODS_RETURN) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_GENERAL_RETURN(d,from) \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_RETURN(d,from,BOOST_VMD_DETAIL_MODS_RETURN_TUPLE) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_ARRAY_RETURN(d,from) \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_RETURN(d,from,BOOST_VMD_DETAIL_MODS_RETURN_ARRAY) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_LIST_RETURN(d,from) \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_RETURN(d,from,BOOST_VMD_DETAIL_MODS_RETURN_LIST) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER(from) \ + BOOST_PP_EQUAL \ + ( \ + BOOST_PP_TUPLE_ELEM(1,from), \ + BOOST_VMD_DETAIL_MODS_RETURN_AFTER \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER_D(d,from) \ + BOOST_PP_EQUAL_D \ + ( \ + d, \ + BOOST_PP_TUPLE_ELEM(1,from), \ + BOOST_VMD_DETAIL_MODS_RETURN_AFTER \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_TYPES(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_SEQUENCE_STATE_TYPES_ELEM,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_INDEX(state) \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_SEQUENCE_STATE_INDEX_ELEM,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_IS_EMPTY(state) \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_FROM_EMPTY(state,data) \ + (data) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_TO_SEQ(state,data) \ + BOOST_PP_SEQ_PUSH_BACK(BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state),data) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_TO_TUPLE(state,data) \ + BOOST_PP_TUPLE_PUSH_BACK(BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state),data) \ +/**/ + +// Array + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_BOOST_VMD_TYPE_ARRAY(d,state,data) \ + BOOST_PP_ARRAY_PUSH_BACK(BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state),data) \ +/**/ + +// List + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_BOOST_VMD_TYPE_LIST(d,state,data) \ + BOOST_PP_LIST_APPEND_D(d,BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state),(data,BOOST_PP_NIL)) \ +/**/ + +// Seq + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_BOOST_VMD_TYPE_SEQ(d,state,data) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_IS_EMPTY(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_FROM_EMPTY, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_TO_SEQ \ + ) \ + (state,data) \ +/**/ + +// Tuple + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_BOOST_VMD_TYPE_TUPLE(d,state,data) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_IS_EMPTY(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_FROM_EMPTY, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_TO_TUPLE \ + ) \ + (state,data) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_GET_NAME(state) \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_OUTTYPE(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_PROCESS(d,name,state,data) \ + name(d,state,data) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_GET_DATA(d,state,tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_NO_RETURN \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_FROM(state) \ + ), \ + BOOST_PP_TUPLE_ELEM, \ + BOOST_VMD_IDENTITY(tuple) \ + ) \ + (1,tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD(d,state,ttuple) \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_PROCESS \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_GET_NAME(state), \ + state, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD_GET_DATA(d,state,ttuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_PROCESSING_ELEM_CHECK(d,state) \ + BOOST_PP_EQUAL_D \ + ( \ + d, \ + BOOST_PP_SEQ_SIZE(BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state)), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_PROCESSING_ELEM(d,state) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM(state)), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_SEQUENCE_PROCESSING_ELEM_CHECK \ + ) \ + (d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_GET_TYPE(state) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_SEQUENCE_STATE_INDEX(state),BOOST_VMD_DETAIL_SEQUENCE_STATE_TYPES(state)) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_STATE_GET_TYPE_REENTRANT(state) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 1, \ + BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_SEQUENCE_STATE_INDEX(state),BOOST_VMD_DETAIL_SEQUENCE_STATE_TYPES(state)) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_INNER_OP_UNKNOWN(d,state) \ + ( \ + , \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD(d,state,(BOOST_VMD_TYPE_UNKNOWN,BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT(state))), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_OUTTYPE(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_FROM(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_TYPES(state), \ + BOOST_PP_INC(BOOST_VMD_DETAIL_SEQUENCE_STATE_INDEX(state)) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_GET_FULL_TYPE_CHECK_ID(d,type,id) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,type,BOOST_VMD_TYPE_IDENTIFIER), \ + BOOST_VMD_DETAIL_IDENTIFIER_TYPE_D, \ + BOOST_VMD_IDENTITY(type) \ + ) \ + (d,id) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_GET_FULL_TYPE(d,state,tuple) \ + BOOST_VMD_DETAIL_SEQUENCE_GET_FULL_TYPE_CHECK_ID \ + ( \ + d, \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_TYPE_, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_GET_TYPE(state) \ + ), \ + BOOST_PP_TUPLE_ELEM(0,tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_FOUND_PROCESS(d,state,tuple) \ + ( \ + BOOST_PP_TUPLE_ELEM(1,tuple), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD \ + ( \ + d, \ + state, \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_GET_FULL_TYPE(d,state,tuple), \ + BOOST_PP_TUPLE_ELEM(0,tuple) \ + ) \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_OUTTYPE(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_FROM(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_TYPES(state), \ + BOOST_PP_INC(BOOST_PP_TUPLE_SIZE(BOOST_VMD_DETAIL_SEQUENCE_STATE_TYPES(state))) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_FOUND_SEQ_SINGLE(d,tuple) \ + BOOST_PP_EQUAL_D(d,BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(0,tuple)),1) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_FOUND_SEQ(d,state,tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_GET_FULL_TYPE(d,state,tuple), \ + BOOST_VMD_TYPE_SEQ \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_FOUND_SEQ_SINGLE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,tuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_FOUND(d,state,tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_FOUND_SEQ(d,state,tuple), \ + BOOST_VMD_DETAIL_SEQUENCE_INCREMENT_INDEX, \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_FOUND_PROCESS \ + ) \ + (d,state,tuple) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_INCREMENT_INDEX(d,state,tuple) \ + BOOST_PP_TUPLE_REPLACE_D(d,state,BOOST_VMD_DETAIL_SEQUENCE_STATE_INDEX_ELEM,BOOST_PP_INC(BOOST_VMD_DETAIL_SEQUENCE_STATE_INDEX(state))) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TEST_TYPE_TUPLE(d,state,tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM(0,tuple) \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_INCREMENT_INDEX, \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_FOUND \ + ) \ + (d,state,tuple) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TEST_TYPE(d,call,state) \ + BOOST_VMD_DETAIL_SEQUENCE_TEST_TYPE_TUPLE \ + ( \ + d, \ + state, \ + call(BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT(state),BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TEST_TYPE_D(d,call,state) \ + BOOST_VMD_DETAIL_SEQUENCE_TEST_TYPE_TUPLE \ + ( \ + d, \ + state, \ + call(d,BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT(state),BOOST_VMD_RETURN_AFTER) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_GCLRT(state) \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_DETAIL_, \ + BOOST_PP_CAT(BOOST_VMD_DETAIL_SEQUENCE_STATE_GET_TYPE(state),_D) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_GCLPL(state) \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_DETAIL_, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_GET_TYPE(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_INNER_OP_TEST_GCL(state,rflag) \ + BOOST_PP_IIF \ + ( \ + rflag, \ + BOOST_VMD_DETAIL_SEQUENCE_GCLRT, \ + BOOST_VMD_DETAIL_SEQUENCE_GCLPL \ + ) \ + (state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_INNER_OP_TEST_RT_CALL(d,call,state,rflag) \ + BOOST_PP_IIF \ + ( \ + rflag, \ + BOOST_VMD_DETAIL_SEQUENCE_TEST_TYPE_D, \ + BOOST_VMD_DETAIL_SEQUENCE_TEST_TYPE \ + ) \ + (d,call,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_INNER_OP_TEST_RT(d,state,rflag) \ + BOOST_VMD_DETAIL_SEQUENCE_INNER_OP_TEST_RT_CALL \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_INNER_OP_TEST_GCL(state,rflag), \ + state, \ + rflag \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_INNER_OP_TEST(d,state) \ + BOOST_VMD_DETAIL_SEQUENCE_INNER_OP_TEST_RT \ + ( \ + d, \ + state, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_GET_TYPE_REENTRANT(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_INNER_OP(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_INDEX(state), \ + BOOST_PP_TUPLE_SIZE(BOOST_VMD_DETAIL_SEQUENCE_STATE_TYPES(state)) \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_INNER_OP_UNKNOWN, \ + BOOST_VMD_DETAIL_SEQUENCE_INNER_OP_TEST \ + ) \ + (d,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_INNER_PRED(d,state) \ + BOOST_PP_NOT_EQUAL_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_INDEX(state), \ + BOOST_PP_INC(BOOST_PP_TUPLE_SIZE(BOOST_VMD_DETAIL_SEQUENCE_STATE_TYPES(state))) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_OP_PAREN_TUPLE_TYPES_ELEM_FROM(d,from) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_GENERAL_RETURN(d,from), \ + ((SEQ,1),(TUPLE,1)), \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_EXACT_RETURN(d,from), \ + ((SEQ,1),(LIST,1),(ARRAY,1),(TUPLE,1)), \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_ARRAY_RETURN(d,from), \ + ((SEQ,1),(ARRAY,1),(TUPLE,1)), \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_LIST_RETURN(d,from), \ + ((SEQ,1),(LIST,1),(TUPLE,1)), \ + ((SEQ,1),(TUPLE,1)) \ + ) \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_OP_PAREN_TUPLE_TYPES_ELEM(d,state) \ + BOOST_VMD_DETAIL_SEQUENCE_OP_PAREN_TUPLE_TYPES_ELEM_FROM \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_FROM(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_OP_PAREN_TUPLE_TYPES_ANY(d,state) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM(state) \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_OP_PAREN_TUPLE_TYPES_ELEM, \ + BOOST_VMD_IDENTITY(((SEQ,1),(TUPLE,1))) \ + ) \ + (d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_OP_PAREN_TUPLE_TYPES(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_PROCESSING_ELEM(d,state), \ + BOOST_VMD_DETAIL_SEQUENCE_OP_PAREN_TUPLE_TYPES_ELEM, \ + BOOST_VMD_DETAIL_SEQUENCE_OP_PAREN_TUPLE_TYPES_ANY \ + ) \ + (d,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_OP_PAREN(d,state) \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_INNER_PRED, \ + BOOST_VMD_DETAIL_SEQUENCE_INNER_OP, \ + BOOST_PP_TUPLE_PUSH_BACK \ + ( \ + BOOST_PP_TUPLE_PUSH_BACK \ + ( \ + state, \ + BOOST_VMD_DETAIL_SEQUENCE_OP_PAREN_TUPLE_TYPES(d,state) \ + ), \ + 0 \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_OP_ID_LOOP(d,state) \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_INNER_PRED, \ + BOOST_VMD_DETAIL_SEQUENCE_INNER_OP, \ + BOOST_PP_TUPLE_PUSH_BACK(BOOST_PP_TUPLE_PUSH_BACK(state,((IDENTIFIER,1))),0) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_OP_ID_EL(d,state) \ + ( \ + BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_DETAIL_LIST_D(d,BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT(state),BOOST_VMD_RETURN_AFTER)), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT_ADD(d,state,(BOOST_VMD_TYPE_LIST,BOOST_PP_NIL)), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_OUTTYPE(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_FROM(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_OP_ID(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY_LIST_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_IDENTIFIER_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT(state) \ + ) \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_OP_ID_EL, \ + BOOST_VMD_DETAIL_SEQUENCE_OP_ID_LOOP \ + ) \ + (d,state) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_OP_REDUCE_STATE(state) \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_OUTTYPE(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_FROM(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_OP(d,state) \ + BOOST_VMD_DETAIL_SEQUENCE_OP_REDUCE_STATE \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT(state) \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_OP_PAREN, \ + BOOST_VMD_DETAIL_SEQUENCE_OP_ID \ + ) \ + (d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_PRED_CELEM_SZ(d,state) \ + BOOST_PP_LESS_EQUAL_D \ + ( \ + d, \ + BOOST_PP_SEQ_SIZE(BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state)), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM(state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_PRED_CELEM(d,state) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_ELEM(state) \ + ), \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state) \ + ) \ + ), \ + BOOST_VMD_IDENTITY(1), \ + BOOST_VMD_DETAIL_SEQUENCE_PRED_CELEM_SZ \ + ) \ + (d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_PRED(d,state) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT(state) \ + ), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_VMD_DETAIL_SEQUENCE_PRED_CELEM \ + ) \ + (d,state) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_EMPTY_TYPE_CHECK(output) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(output,BOOST_VMD_TYPE_ARRAY), \ + (0,()), \ + BOOST_PP_NIL \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_EMPTY_TYPE_CHECK_D(d,output) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,output,BOOST_VMD_TYPE_ARRAY), \ + (0,()), \ + BOOST_PP_NIL \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_EMPTY_TYPE(output) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(output,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE(output,BOOST_VMD_TYPE_TUPLE) \ + ), \ + BOOST_VMD_EMPTY, \ + BOOST_VMD_DETAIL_SEQUENCE_EMPTY_TYPE_CHECK \ + ) \ + (output) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_EMPTY_TYPE_D(d,output) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITOR \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,output,BOOST_VMD_TYPE_SEQ), \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,output,BOOST_VMD_TYPE_TUPLE) \ + ), \ + BOOST_VMD_EMPTY, \ + BOOST_VMD_DETAIL_SEQUENCE_EMPTY_TYPE_CHECK_D \ + ) \ + (d,output) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE_GET(state) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_FROM(state) \ + ), \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT(state) \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state) \ + ) +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE_GET_D(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_FROM(state) \ + ), \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_INPUT(state) \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_RESULT(state) \ + ) +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE(vseq,elem,output,from) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE_GET \ + ( \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_PRED, \ + BOOST_VMD_DETAIL_SEQUENCE_OP, \ + ( \ + vseq, \ + BOOST_VMD_DETAIL_SEQUENCE_EMPTY_TYPE \ + ( \ + output \ + ), \ + elem, \ + output, \ + from \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE_D(d,vseq,elem,output,from) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE_GET_D \ + ( \ + d, \ + BOOST_PP_WHILE_ ## d \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_PRED, \ + BOOST_VMD_DETAIL_SEQUENCE_OP, \ + ( \ + vseq, \ + BOOST_VMD_DETAIL_SEQUENCE_EMPTY_TYPE_D \ + ( \ + d, \ + output \ + ), \ + elem, \ + output, \ + from \ + ) \ + ) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_SEQUENCE_COMMON_HPP */ diff --git a/boost/vmd/detail/sequence_elem.hpp b/boost/vmd/detail/sequence_elem.hpp new file mode 100644 index 0000000000..541b1a5028 --- /dev/null +++ b/boost/vmd/detail/sequence_elem.hpp @@ -0,0 +1,985 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SEQUENCE_ELEM_HPP) +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_HPP + +#include <boost/preprocessor/arithmetic/dec.hpp> +#include <boost/preprocessor/comparison/greater.hpp> +#include <boost/preprocessor/control/expr_if.hpp> +#include <boost/preprocessor/control/expr_iif.hpp> +#include <boost/preprocessor/control/if.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/logical/bitand.hpp> +#include <boost/preprocessor/logical/bitor.hpp> +#include <boost/preprocessor/logical/compl.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/push_back.hpp> +#include <boost/preprocessor/tuple/replace.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_identifier.hpp> +#include <boost/vmd/detail/empty_result.hpp> +#include <boost/vmd/detail/equal_type.hpp> +#include <boost/vmd/detail/match_identifier.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/not_empty.hpp> +#include <boost/vmd/detail/only_after.hpp> +#include <boost/vmd/detail/sequence_common.hpp> + +/* + + Given modifications and the requested type, + determine whether or not we should be checking for specific identifiers + + 1 = check for specific identifiers + 0 = do no check for specific identifiers + +*/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_CHECK_FOR_IDENTIFIERS(nm,type) \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + type, \ + BOOST_VMD_TYPE_IDENTIFIER \ + ), \ + BOOST_VMD_DETAIL_NOT_EMPTY \ + ( \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(nm) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_CHECK_FOR_IDENTIFIERS_D(d,nm,type) \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + type, \ + BOOST_VMD_TYPE_IDENTIFIER \ + ), \ + BOOST_VMD_DETAIL_NOT_EMPTY \ + ( \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(nm) \ + ) \ + ) \ +/**/ + +/* + + Given modifications, determine whether or not an index should be part of the result + + 1 = index should be part of the result + 0 = index should not be part of the result + +*/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_IS_INDEX_RESULT(nm) \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_INDEX(nm), \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + BOOST_VMD_DETAIL_MODS_RESULT_TYPE(nm), \ + BOOST_VMD_TYPE_IDENTIFIER \ + ), \ + BOOST_VMD_DETAIL_NOT_EMPTY \ + ( \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(nm) \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_IS_INDEX_RESULT_D(d,nm) \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_INDEX(nm), \ + BOOST_PP_BITAND \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_MODS_RESULT_TYPE(nm), \ + BOOST_VMD_TYPE_IDENTIFIER \ + ), \ + BOOST_VMD_DETAIL_NOT_EMPTY \ + ( \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(nm) \ + ) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT_INDEX(nm) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER(nm), \ + (,,), \ + (,) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT_NO_INDEX(nm) \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER(nm), \ + (,) \ + ) \ +/**/ + +/* + + Returns a failure result given the modifications + +*/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT(nm) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_FIN \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_IS_INDEX_RESULT(nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT_INDEX, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT_NO_INDEX \ + ) \ + (nm),nm, \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT_D(d,nm) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_FIN \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_IS_INDEX_RESULT_D(d,nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT_INDEX, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT_NO_INDEX \ + ) \ + (nm),nm, \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_TYPE_TUPLE(res) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_PP_TUPLE_ELEM(0,res) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_TYPE_ONLY(res) \ + BOOST_PP_TUPLE_ELEM(0,res) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA_TUPLE(res) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 1, \ + BOOST_PP_TUPLE_ELEM(0,res) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA_ONLY(res) \ + BOOST_PP_TUPLE_ELEM(1,res) \ +/**/ + +/* + + Gets the 'data' of the result given the result and modifications + +*/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA(res,nm) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER(nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA_TUPLE, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA_ONLY \ + ) \ + (res) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA_D(d,res,nm) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER_D(d,nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA_TUPLE, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA_ONLY \ + ) \ + (res) \ +/**/ + +/* + + Gets the 'type' of the result given the result and modifications + +*/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_TYPE(res,nm) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER(nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_TYPE_TUPLE, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_TYPE_ONLY \ + ) \ + (res) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_TYPE_D(d,res,nm) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER_D(d,nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_TYPE_TUPLE, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_TYPE_ONLY \ + ) \ + (res) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_HAS_FAILED_TUPLE(res) \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM(0,res) \ + ) \ +/**/ + +/* + + Determines whether the result from the element access has failed or not + + returns 1 if it has failed, otherwise 0. + +*/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_HAS_FAILED(res,nm) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER(nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_HAS_FAILED_TUPLE, \ + BOOST_VMD_IS_EMPTY \ + ) \ + (res) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_HAS_FAILED_D(d,res,nm) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER_D(d,nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_HAS_FAILED_TUPLE, \ + BOOST_VMD_IS_EMPTY \ + ) \ + (res) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_ONLY_CHELM(seq,elem) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_GREATER(BOOST_PP_SEQ_SIZE(seq),elem), \ + BOOST_PP_SEQ_ELEM, \ + BOOST_VMD_EMPTY \ + ) \ + (elem,seq) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_ONLY_CHELM_D(d,seq,elem) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_GREATER_D(d,BOOST_PP_SEQ_SIZE(seq),elem), \ + BOOST_PP_SEQ_ELEM, \ + BOOST_VMD_EMPTY \ + ) \ + (elem,seq) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_AFTER_CHELM_RES(data,elem) \ + ( \ + BOOST_PP_SEQ_ELEM(elem,BOOST_PP_TUPLE_ELEM(0,data)), \ + BOOST_PP_TUPLE_ELEM(1,data) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_AFTER_CHELM(data,elem) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_GREATER(BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(0,data)),elem), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_AFTER_CHELM_RES, \ + BOOST_VMD_DETAIL_EMPTY_RESULT \ + ) \ + (data,elem) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_AFTER_CHELM_D(d,data,elem) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_GREATER_D(d,BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(0,data)),elem), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_AFTER_CHELM_RES, \ + BOOST_VMD_DETAIL_EMPTY_RESULT \ + ) \ + (data,elem) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_ONLY(seq,elem) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(seq), \ + BOOST_VMD_EMPTY, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_ONLY_CHELM \ + ) \ + (seq,elem) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_ONLY_D(d,seq,elem) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(seq), \ + BOOST_VMD_EMPTY, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_ONLY_CHELM_D \ + ) \ + (d,seq,elem) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_AFTER(data,elem) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,data)), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_AFTER_CHELM \ + ) \ + (data,elem) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_AFTER_D(d,data,elem) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,data)), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_AFTER_CHELM_D \ + ) \ + (d,data,elem) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ(seq,elem,nm) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER(nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_AFTER, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_ONLY \ + ) \ + (seq,elem) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_D(d,seq,elem,nm) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER_D(d,nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_AFTER_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_ONLY_D \ + ) \ + (d,seq,elem) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(...) \ + BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PROCESS(elem,vseq,nm) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE \ + ( \ + vseq, \ + elem, \ + BOOST_VMD_TYPE_SEQ, \ + nm \ + ), \ + elem, \ + nm \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PROCESS_D(d,elem,vseq,nm) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FSEQ_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE_D \ + ( \ + d, \ + vseq, \ + elem, \ + BOOST_VMD_TYPE_SEQ, \ + nm \ + ), \ + elem, \ + nm \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_EMPTY(elem,vseq,nm) \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER(nm), \ + (,) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_EMPTY_D(d,elem,vseq,nm) \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER_D(d,nm), \ + (,) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_CE(elem,vseq,nm) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(vseq), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PROCESS, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_EMPTY \ + ) \ + (elem,vseq,nm) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_CE_D(d,elem,vseq,nm) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(vseq), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PROCESS_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_EMPTY_D \ + ) \ + (d,elem,vseq,nm) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_FIN_D(d,res,nm,type) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_FIN(res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_FIN(res,nm,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_ONLY_AFTER(nm), \ + BOOST_PP_TUPLE_ELEM, \ + BOOST_VMD_IDENTITY(res) \ + ) \ + (1,res) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_INDEX_JRES(data,index) \ + BOOST_PP_IF \ + ( \ + index, \ + (data,BOOST_PP_DEC(index)), \ + (,) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_JRES(data,index) \ + BOOST_PP_EXPR_IF \ + ( \ + index, \ + data \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_MATCH(data,nm,index) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_INDEX(nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_INDEX_JRES, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_JRES \ + ) \ + (data,index) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY_ID_TUP(data,nm) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_MATCH \ + ( \ + data, \ + nm, \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER \ + ( \ + data, \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(nm) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY_ID_TUP_D(d,data,nm) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_MATCH \ + ( \ + data, \ + nm, \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_D \ + ( \ + d, \ + data, \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(nm) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY_ID(data,nm,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_CHECK_FOR_IDENTIFIERS(nm,type), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY_ID_TUP, \ + BOOST_VMD_IDENTITY(data) \ + ) \ + (data,nm) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY_ID_D(d,data,nm,type) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_CHECK_FOR_IDENTIFIERS_D(d,nm,type), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY_ID_TUP_D, \ + BOOST_VMD_IDENTITY(data) \ + ) \ + (d,data,nm) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY(res,nm,type) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY_ID \ + ( \ + BOOST_PP_TUPLE_ELEM(1,res), \ + nm, \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY_D(d,res,nm,type) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY_ID_D \ + ( \ + d, \ + BOOST_PP_TUPLE_ELEM(1,res), \ + nm, \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_CHANGE(res,nm,type) \ + BOOST_PP_TUPLE_REPLACE \ + ( \ + res, \ + 0, \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 1, \ + BOOST_PP_TUPLE_ELEM(0,res) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_CHANGE_D(d,res,nm,type) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + res, \ + 0, \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 1, \ + BOOST_PP_TUPLE_ELEM(0,res) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ONLY_CAFTER(res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_ONLY_AFTER(nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_FIN, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_CHANGE \ + ) \ + (res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ONLY_CAFTER_D(d,res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_ONLY_AFTER(nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_FIN_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_CHANGE_D \ + ) \ + (d,res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_SUCCESS(res,nm,type,index) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ONLY_CAFTER \ + ( \ + BOOST_PP_TUPLE_PUSH_BACK(res,BOOST_PP_DEC(index)), \ + nm, \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_SUCCESS_D(d,res,nm,type,index) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ONLY_CAFTER_D \ + ( \ + d, \ + BOOST_PP_TUPLE_PUSH_BACK(res,BOOST_PP_DEC(index)), \ + nm, \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_FAILURE(res,nm,type,index) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT(nm) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_FAILURE_D(d,res,nm,type,index) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT_D(d,nm) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_INDEX_JRES(res,nm,type,index) \ + BOOST_PP_IF \ + ( \ + index, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_SUCCESS, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_FAILURE \ + ) \ + (res,nm,type,index) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_INDEX_JRES_D(d,res,nm,type,index) \ + BOOST_PP_IF \ + ( \ + index, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_SUCCESS_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_FAILURE_D \ + ) \ + (d,res,nm,type,index) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_JRES_FAILURE(res,nm,type) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT(nm) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_JRES_FAILURE_D(d,res,nm,type) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT_D(d,nm) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_JRES(res,nm,type,index) \ + BOOST_PP_IF \ + ( \ + index, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ONLY_CAFTER, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_JRES_FAILURE \ + ) \ + (res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_JRES_D(d,res,nm,type,index) \ + BOOST_PP_IF \ + ( \ + index, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ONLY_CAFTER_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_JRES_FAILURE_D \ + ) \ + (d,res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ID_RES(res,nm,type,index) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_INDEX(nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_INDEX_JRES, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_JRES \ + ) \ + (res,nm,type,index) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ID_RES_D(d,res,nm,type,index) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_INDEX(nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_INDEX_JRES_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_JRES_D \ + ) \ + (d,res,nm,type,index) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ID(res,nm,type) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ID_RES \ + ( \ + res, \ + nm, \ + type, \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA(res,nm), \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(nm) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ID_D(d,res,nm,type) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ID_RES_D \ + ( \ + d, \ + res, \ + nm, \ + type, \ + BOOST_VMD_DETAIL_MATCH_IDENTIFIER_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA_D(d,res,nm), \ + BOOST_VMD_DETAIL_MODS_RESULT_OTHER(nm) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT(res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_CHECK_FOR_IDENTIFIERS(nm,type), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ID, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ONLY_CAFTER \ + ) \ + (res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_D(d,res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_CHECK_FOR_IDENTIFIERS_D(d,nm,type), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ID_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_ONLY_CAFTER_D \ + ) \ + (d,res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK(res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER(nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY \ + ) \ + (res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_D(d,res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_STATE_IS_AFTER_D(d,nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_SPLIT_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_ONLY_D \ + ) \ + (d,res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_FAILED(res,nm,type) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT(nm) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_FAILED_D(d,res,nm,type) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT_D(d,nm) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE_ID(res,nm,type) \ + BOOST_VMD_IS_IDENTIFIER \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA(res,nm) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE_ID_D(d,res,nm,type) \ + BOOST_VMD_IS_IDENTIFIER_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_DATA_D(d,res,nm) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE_OTHER(res,nm,type) \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_TYPE(res,nm), \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE_OTHER_D(d,res,nm,type) \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_RESULT_TYPE_D(d,res,nm), \ + type \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE(res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + BOOST_VMD_TYPE_IDENTIFIER, \ + type \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE_ID, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE_OTHER \ + ) \ + (res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE_D(d,res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + BOOST_VMD_TYPE_IDENTIFIER, \ + type \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE_ID_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE_OTHER_D \ + ) \ + (d,res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT(res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE(res,nm,type), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_FAILED \ + ) \ + (res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_D(d,res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_MATCHING_TYPE_D(d,res,nm,type), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_CHECK_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_FAILED_D \ + ) \ + (d,res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE_NF(res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(type), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_FIN, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT \ + ) \ + (res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE_NF_D(d,res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(type), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_FIN_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_PT_D \ + ) \ + (d,res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE_FAILED(res,nm,type) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT(nm) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE_FAILED_D(d,res,nm,type) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_FAILURE_RESULT_D(d,nm) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE(res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_HAS_FAILED(res,nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE_FAILED, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE_NF \ + ) \ + (res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE_D(d,res,nm,type) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_HAS_FAILED_D(d,res,nm), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE_FAILED_D, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE_NF_D \ + ) \ + (d,res,nm,type) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_COA(res,nm) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE \ + ( \ + res, \ + nm, \ + BOOST_VMD_DETAIL_MODS_RESULT_TYPE(nm) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_COA_D(d,res,nm) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_TYPE_D \ + ( \ + d, \ + res, \ + nm, \ + BOOST_VMD_DETAIL_MODS_RESULT_TYPE(nm) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM(elem,vseq,nm) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_COA \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_CE(elem,vseq,nm), \ + nm \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_D(d,elem,vseq,nm) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_COA_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_CE_D(d,elem,vseq,nm), \ + nm \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM(allow,elem,...) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM \ + ( \ + elem, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \ + BOOST_VMD_DETAIL_NEW_MODS(allow,__VA_ARGS__) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ELEM_D(d,allow,elem,...) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_NM_D \ + ( \ + d, \ + elem, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \ + BOOST_VMD_DETAIL_NEW_MODS_D(d,allow,__VA_ARGS__) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_SEQUENCE_ELEM_HPP */ diff --git a/boost/vmd/detail/sequence_enum.hpp b/boost/vmd/detail/sequence_enum.hpp new file mode 100644 index 0000000000..4e8a12eeab --- /dev/null +++ b/boost/vmd/detail/sequence_enum.hpp @@ -0,0 +1,40 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SEQUENCE_ENUM_HPP) +#define BOOST_VMD_DETAIL_SEQUENCE_ENUM_HPP + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/enum.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/sequence_to_tuple.hpp> + +#define BOOST_VMD_DETAIL_SEQUENCE_ENUM_PROCESS(tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(tuple), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_TUPLE_ENUM \ + ) \ + (tuple) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ENUM(...) \ + BOOST_VMD_DETAIL_SEQUENCE_ENUM_PROCESS \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE(__VA_ARGS__) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_ENUM_D(d,...) \ + BOOST_VMD_DETAIL_SEQUENCE_ENUM_PROCESS \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE_D(d,__VA_ARGS__) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_SEQUENCE_ENUM_HPP */ diff --git a/boost/vmd/detail/sequence_size.hpp b/boost/vmd/detail/sequence_size.hpp new file mode 100644 index 0000000000..0f308eb829 --- /dev/null +++ b/boost/vmd/detail/sequence_size.hpp @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SEQUENCE_SIZE_HPP) +#define BOOST_VMD_DETAIL_SEQUENCE_SIZE_HPP + +#include <boost/preprocessor/array/size.hpp> +#include <boost/vmd/detail/sequence_to_array.hpp> + +#define BOOST_VMD_DETAIL_SEQUENCE_SIZE(vseq) \ + BOOST_PP_ARRAY_SIZE(BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY(vseq)) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_SIZE_D(d,vseq) \ + BOOST_PP_ARRAY_SIZE(BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY_D(d,vseq)) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_SEQUENCE_SIZE_HPP */ diff --git a/boost/vmd/detail/sequence_to_array.hpp b/boost/vmd/detail/sequence_to_array.hpp new file mode 100644 index 0000000000..a9383a95e8 --- /dev/null +++ b/boost/vmd/detail/sequence_to_array.hpp @@ -0,0 +1,47 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY_HPP) +#define BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY_HPP + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/vmd/detail/modifiers.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/not_empty.hpp> +#include <boost/vmd/detail/sequence_elem.hpp> + +#define BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY(...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__)), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \ + , \ + BOOST_VMD_TYPE_ARRAY, \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_RETURN,__VA_ARGS__) \ + ), \ + (0,()) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY_D(d,...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__)), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \ + , \ + BOOST_VMD_TYPE_ARRAY, \ + BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_RETURN,__VA_ARGS__) \ + ), \ + (0,()) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY_HPP */ diff --git a/boost/vmd/detail/sequence_to_list.hpp b/boost/vmd/detail/sequence_to_list.hpp new file mode 100644 index 0000000000..1d612c47e8 --- /dev/null +++ b/boost/vmd/detail/sequence_to_list.hpp @@ -0,0 +1,47 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SEQUENCE_TO_LIST_HPP) +#define BOOST_VMD_DETAIL_SEQUENCE_TO_LIST_HPP + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/vmd/detail/modifiers.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/not_empty.hpp> +#include <boost/vmd/detail/sequence_elem.hpp> + +#define BOOST_VMD_DETAIL_SEQUENCE_TO_LIST(...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__)), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \ + , \ + BOOST_VMD_TYPE_LIST, \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_RETURN,__VA_ARGS__) \ + ), \ + BOOST_PP_NIL \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TO_LIST_D(d,...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__)), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \ + , \ + BOOST_VMD_TYPE_LIST, \ + BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_RETURN,__VA_ARGS__) \ + ), \ + BOOST_PP_NIL \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_SEQUENCE_TO_LIST_HPP */ diff --git a/boost/vmd/detail/sequence_to_seq.hpp b/boost/vmd/detail/sequence_to_seq.hpp new file mode 100644 index 0000000000..d2aaee9124 --- /dev/null +++ b/boost/vmd/detail/sequence_to_seq.hpp @@ -0,0 +1,45 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SEQUENCE_TO_SEQ_HPP) +#define BOOST_VMD_DETAIL_SEQUENCE_TO_SEQ_HPP + +#include <boost/preprocessor/control/expr_iif.hpp> +#include <boost/vmd/detail/modifiers.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/not_empty.hpp> +#include <boost/vmd/detail/sequence_elem.hpp> + +#define BOOST_VMD_DETAIL_SEQUENCE_TO_SEQ(...) \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__)), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \ + , \ + BOOST_VMD_TYPE_SEQ, \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_RETURN,__VA_ARGS__) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TO_SEQ_D(d,...) \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__)), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \ + , \ + BOOST_VMD_TYPE_SEQ, \ + BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_RETURN,__VA_ARGS__) \ + ) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_SEQUENCE_TO_SEQ_HPP */ diff --git a/boost/vmd/detail/sequence_to_tuple.hpp b/boost/vmd/detail/sequence_to_tuple.hpp new file mode 100644 index 0000000000..cb5286c63c --- /dev/null +++ b/boost/vmd/detail/sequence_to_tuple.hpp @@ -0,0 +1,45 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE_HPP) +#define BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE_HPP + +#include <boost/preprocessor/control/expr_iif.hpp> +#include <boost/vmd/detail/modifiers.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/not_empty.hpp> +#include <boost/vmd/detail/sequence_elem.hpp> + +#define BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE(...) \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__)), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \ + , \ + BOOST_VMD_TYPE_TUPLE, \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_RETURN,__VA_ARGS__) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE_D(d,...) \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_VMD_DETAIL_NOT_EMPTY(BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__)), \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_PROCESS_TUPLE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_GET_VSEQ(__VA_ARGS__), \ + , \ + BOOST_VMD_TYPE_TUPLE, \ + BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_RETURN,__VA_ARGS__) \ + ) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE_HPP */ diff --git a/boost/vmd/detail/sequence_type.hpp b/boost/vmd/detail/sequence_type.hpp new file mode 100644 index 0000000000..4b0a0f9527 --- /dev/null +++ b/boost/vmd/detail/sequence_type.hpp @@ -0,0 +1,274 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SEQUENCE_TYPE_HPP) +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_HPP + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/preprocessor/variadic/size.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/detail/equal_type.hpp> +#include <boost/vmd/detail/is_array_common.hpp> +#include <boost/vmd/detail/is_list.hpp> +#include <boost/vmd/detail/modifiers.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/sequence_elem.hpp> + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_ARRAY(dtuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX(BOOST_PP_TUPLE_ELEM(1,dtuple)), \ + BOOST_VMD_TYPE_ARRAY, \ + BOOST_VMD_TYPE_TUPLE \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_ARRAY_D(d,dtuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX_D(d,BOOST_PP_TUPLE_ELEM(1,dtuple)), \ + BOOST_VMD_TYPE_ARRAY, \ + BOOST_VMD_TYPE_TUPLE \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_LIST(dtuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_LIST(BOOST_PP_TUPLE_ELEM(1,dtuple)), \ + BOOST_VMD_TYPE_LIST, \ + BOOST_VMD_TYPE_TUPLE \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_LIST_D(d,dtuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_IS_LIST_D(d,BOOST_PP_TUPLE_ELEM(1,dtuple)), \ + BOOST_VMD_TYPE_LIST, \ + BOOST_VMD_TYPE_TUPLE \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_BOTH(dtuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE \ + ( \ + BOOST_VMD_TYPE_TUPLE, \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_LIST(dtuple) \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_ARRAY, \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_LIST) \ + ) \ + (dtuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_BOTH_D(d,dtuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D \ + ( \ + d, \ + BOOST_VMD_TYPE_TUPLE, \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_LIST_D(d,dtuple) \ + ), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_ARRAY_D, \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_LIST) \ + ) \ + (d,dtuple) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_MODS(dtuple,rtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(rtype,BOOST_VMD_DETAIL_MODS_RETURN_ARRAY), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_ARRAY, \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(rtype,BOOST_VMD_DETAIL_MODS_RETURN_LIST), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_LIST, \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(rtype,BOOST_VMD_DETAIL_MODS_RETURN_TUPLE), \ + BOOST_VMD_IDENTITY(BOOST_PP_TUPLE_ELEM(0,dtuple)), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_BOTH \ + ) \ + ) \ + ) \ + ) \ + (dtuple) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_MODS_D(d,dtuple,rtype) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,rtype,BOOST_VMD_DETAIL_MODS_RETURN_ARRAY), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_ARRAY_D, \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,rtype,BOOST_VMD_DETAIL_MODS_RETURN_LIST), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_LIST_D, \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D(d,rtype,BOOST_VMD_DETAIL_MODS_RETURN_TUPLE), \ + BOOST_VMD_IDENTITY(BOOST_PP_TUPLE_ELEM(0,dtuple)), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_BOTH_D \ + ) \ + ) \ + ) \ + ) \ + (d,dtuple) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_MORE(dtuple,...) \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_MODS \ + ( \ + dtuple, \ + BOOST_VMD_DETAIL_MODS_RESULT_RETURN_TYPE \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_ALL,__VA_ARGS__) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_MORE_D(d,dtuple,...) \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_MODS_D \ + ( \ + d, \ + dtuple, \ + BOOST_VMD_DETAIL_MODS_RESULT_RETURN_TYPE \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS_D(d,BOOST_VMD_ALLOW_ALL,__VA_ARGS__) \ + ) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_UNARY(dtuple,...) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE(BOOST_VMD_TYPE_TUPLE,BOOST_PP_TUPLE_ELEM(0,dtuple)), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_MORE, \ + BOOST_VMD_IDENTITY(BOOST_PP_TUPLE_ELEM(0,dtuple)) \ + ) \ + (dtuple,__VA_ARGS__) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_UNARY_D(d,dtuple,...) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,BOOST_VMD_TYPE_TUPLE,BOOST_PP_TUPLE_ELEM(0,dtuple)), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_MORE_D, \ + BOOST_VMD_IDENTITY(BOOST_PP_TUPLE_ELEM(0,dtuple)) \ + ) \ + (d,dtuple,__VA_ARGS__) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_SEQUENCE(tuple,...) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,tuple)), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_UNARY, \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_SEQUENCE) \ + ) \ + (BOOST_PP_TUPLE_ELEM(0,tuple),__VA_ARGS__) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_SEQUENCE_D(d,tuple,...) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,tuple)), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_UNARY_D, \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_SEQUENCE) \ + ) \ + (d,BOOST_PP_TUPLE_ELEM(0,tuple),__VA_ARGS__) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE(tuple,...) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,tuple)), \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_EMPTY), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_SEQUENCE \ + ) \ + (tuple,__VA_ARGS__) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_D(d,tuple,...) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,tuple)), \ + BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_EMPTY), \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_SEQUENCE_D \ + ) \ + (d,tuple,__VA_ARGS__) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE(...) \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE \ + ( \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM \ + ( \ + BOOST_VMD_ALLOW_ALL, \ + 0, \ + BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__), \ + BOOST_VMD_RETURN_AFTER, \ + BOOST_VMD_RETURN_TYPE_TUPLE \ + ), \ + __VA_ARGS__ \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_SEQUENCE_TYPE_D(d,...) \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_TUPLE_D \ + ( \ + d, \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_D \ + ( \ + d, \ + BOOST_VMD_ALLOW_ALL, \ + 0, \ + BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__), \ + BOOST_VMD_RETURN_AFTER, \ + BOOST_VMD_RETURN_TYPE_TUPLE \ + ), \ + __VA_ARGS__ \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_SEQUENCE_TYPE_HPP */ diff --git a/boost/vmd/detail/setup.hpp b/boost/vmd/detail/setup.hpp new file mode 100644 index 0000000000..a237be6d93 --- /dev/null +++ b/boost/vmd/detail/setup.hpp @@ -0,0 +1,41 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_SETUP_HPP) +#define BOOST_VMD_DETAIL_SETUP_HPP + +#include <boost/preprocessor/config/config.hpp> + +#if defined(BOOST_VMD_MSVC) +#undef BOOST_VMD_MSVC +#endif +#if defined(BOOST_VMD_MSVC_V8) +#undef BOOST_VMD_MSVC_V8 +#endif +#if BOOST_PP_VARIADICS +#define BOOST_VMD_MSVC BOOST_PP_VARIADICS_MSVC +#if BOOST_VMD_MSVC && defined(_MSC_VER) && _MSC_VER == 1400 +#define BOOST_VMD_MSVC_V8 1 +#else +#define BOOST_VMD_MSVC_V8 0 +#endif /* BOOST_VMD_MSVC && defined(_MSC_VER) && _MSC_VER == 1400 */ +#if !defined(BOOST_VMD_ASSERT_DATA) +#if defined(NDEBUG) +#define BOOST_VMD_ASSERT_DATA 0 +#else +#define BOOST_VMD_ASSERT_DATA 1 +#endif /* NDEBUG */ +#endif /* BOOST_VMD_ASSERT_DATA */ +#else +#define BOOST_VMD_MSVC 0 +#define BOOST_VMD_MSVC_V8 0 +#if defined(BOOST_VMD_ASSERT_DATA) +#undef BOOST_VMD_ASSERT_DATA +#endif +#define BOOST_VMD_ASSERT_DATA 0 +#endif /* BOOST_PP_VARIADICS */ + +#endif /* BOOST_VMD_DETAIL_SETUP_HPP */ diff --git a/boost/vmd/detail/tuple.hpp b/boost/vmd/detail/tuple.hpp new file mode 100644 index 0000000000..f8a614c562 --- /dev/null +++ b/boost/vmd/detail/tuple.hpp @@ -0,0 +1,196 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_TUPLE_HPP) +#define BOOST_VMD_DETAIL_TUPLE_HPP + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/detail/empty_result.hpp> +#include <boost/vmd/detail/mods.hpp> +#include <boost/vmd/detail/parens.hpp> + +#define BOOST_VMD_DETAIL_TUPLE_BST_CS(vseq) \ + BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(BOOST_VMD_DETAIL_BEGIN_PARENS(vseq)),1) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_BST_CS_D(d,vseq) \ + BOOST_PP_EQUAL_D(d,BOOST_PP_TUPLE_SIZE(BOOST_VMD_DETAIL_BEGIN_PARENS(vseq)),1) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_BST(vseq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(vseq), \ + BOOST_VMD_DETAIL_TUPLE_BST_CS, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_BST_D(d,vseq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(vseq), \ + BOOST_VMD_DETAIL_TUPLE_BST_CS_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_BSEQ_NXT(vseq) \ + BOOST_VMD_DETAIL_TUPLE_BST(BOOST_VMD_DETAIL_AFTER_PARENS_DATA(vseq)) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_BSEQ_NXT_D(d,vseq) \ + BOOST_VMD_DETAIL_TUPLE_BST_D(d,BOOST_VMD_DETAIL_AFTER_PARENS_DATA(vseq)) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_BSEQ(vseq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_TUPLE_BST(vseq), \ + BOOST_VMD_DETAIL_TUPLE_BSEQ_NXT, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_BSEQ_D(d,vseq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_TUPLE_BST_D(d,vseq), \ + BOOST_VMD_DETAIL_TUPLE_BSEQ_NXT_D, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (d,vseq) \ + ) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_SPLIT_CHK_SEQ(vseq) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_TUPLE_BSEQ(vseq), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_SPLIT_PARENS \ + ) \ + (vseq) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_SPLIT_CHK_SEQ_D(d,vseq) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_TUPLE_BSEQ_D(d,vseq), \ + BOOST_VMD_DETAIL_EMPTY_RESULT, \ + BOOST_VMD_DETAIL_SPLIT_PARENS \ + ) \ + (vseq) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_SPLIT(vseq) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(vseq), \ + BOOST_VMD_DETAIL_TUPLE_SPLIT_CHK_SEQ, \ + BOOST_VMD_DETAIL_EMPTY_RESULT \ + ) \ + (vseq) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_SPLIT_D(d,vseq) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(vseq), \ + BOOST_VMD_DETAIL_TUPLE_SPLIT_CHK_SEQ_D, \ + BOOST_VMD_DETAIL_EMPTY_RESULT \ + ) \ + (d,vseq) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_PROCESS_CHK_SEQ(vseq) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_TUPLE_BSEQ(vseq), \ + BOOST_VMD_EMPTY, \ + BOOST_VMD_DETAIL_BEGIN_PARENS \ + ) \ + (vseq) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_PROCESS_CHK_SEQ_D(d,vseq) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_TUPLE_BSEQ_D(d,vseq), \ + BOOST_VMD_EMPTY, \ + BOOST_VMD_DETAIL_BEGIN_PARENS \ + ) \ + (vseq) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_PROCESS(vseq) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(vseq), \ + BOOST_VMD_DETAIL_TUPLE_PROCESS_CHK_SEQ, \ + BOOST_VMD_EMPTY \ + ) \ + (vseq) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_PROCESS_D(d,vseq) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS(vseq), \ + BOOST_VMD_DETAIL_TUPLE_PROCESS_CHK_SEQ_D, \ + BOOST_VMD_EMPTY \ + ) \ + (d,vseq) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE(...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ), \ + BOOST_VMD_DETAIL_TUPLE_SPLIT, \ + BOOST_VMD_DETAIL_TUPLE_PROCESS \ + ) \ + (BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#define BOOST_VMD_DETAIL_TUPLE_D(d,...) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \ + ( \ + BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \ + ), \ + BOOST_VMD_DETAIL_TUPLE_SPLIT_D, \ + BOOST_VMD_DETAIL_TUPLE_PROCESS_D \ + ) \ + (d,BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_TUPLE_HPP */ diff --git a/boost/vmd/detail/type_registration.hpp b/boost/vmd/detail/type_registration.hpp new file mode 100644 index 0000000000..29aecf196d --- /dev/null +++ b/boost/vmd/detail/type_registration.hpp @@ -0,0 +1,43 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_IS_TYPE_REGISTRATION_HPP) +#define BOOST_VMD_DETAIL_IS_TYPE_REGISTRATION_HPP + +#define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_UNKNOWN (BOOST_VMD_TYPE_UNKNOWN) +#define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_EMPTY (BOOST_VMD_TYPE_EMPTY) +#define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_ARRAY (BOOST_VMD_TYPE_ARRAY) +#define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_LIST (BOOST_VMD_TYPE_LIST) +#define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_SEQ (BOOST_VMD_TYPE_SEQ) +#define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_TUPLE (BOOST_VMD_TYPE_TUPLE) +#define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_IDENTIFIER (BOOST_VMD_TYPE_IDENTIFIER) +#define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_NUMBER (BOOST_VMD_TYPE_NUMBER) +#define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_SEQUENCE (BOOST_VMD_TYPE_SEQUENCE) +#define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_TYPE (BOOST_VMD_TYPE_TYPE) + +#define BOOST_VMD_DETECT_BOOST_VMD_TYPE_UNKNOWN_BOOST_VMD_TYPE_UNKNOWN +#define BOOST_VMD_DETECT_BOOST_VMD_TYPE_EMPTY_BOOST_VMD_TYPE_EMPTY +#define BOOST_VMD_DETECT_BOOST_VMD_TYPE_ARRAY_BOOST_VMD_TYPE_ARRAY +#define BOOST_VMD_DETECT_BOOST_VMD_TYPE_LIST_BOOST_VMD_TYPE_LIST +#define BOOST_VMD_DETECT_BOOST_VMD_TYPE_SEQ_BOOST_VMD_TYPE_SEQ +#define BOOST_VMD_DETECT_BOOST_VMD_TYPE_TUPLE_BOOST_VMD_TYPE_TUPLE +#define BOOST_VMD_DETECT_BOOST_VMD_TYPE_IDENTIFIER_BOOST_VMD_TYPE_IDENTIFIER +#define BOOST_VMD_DETECT_BOOST_VMD_TYPE_NUMBER_BOOST_VMD_TYPE_NUMBER +#define BOOST_VMD_DETECT_BOOST_VMD_TYPE_SEQUENCE_BOOST_VMD_TYPE_SEQUENCE +#define BOOST_VMD_DETECT_BOOST_VMD_TYPE_TYPE_BOOST_VMD_TYPE_TYPE + +#define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_UNKNOWN (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_UNKNOWN) +#define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_EMPTY (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_EMPTY) +#define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_ARRAY (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_ARRAY) +#define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_LIST (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_LIST) +#define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_SEQ (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_SEQ) +#define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_TUPLE (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_TUPLE) +#define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_IDENTIFIER (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_IDENTIFIER) +#define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_NUMBER (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_NUMBER) +#define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_SEQUENCE (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_SEQUENCE) +#define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_TYPE (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_TYPE) + +#endif /* BOOST_VMD_DETAIL_IS_TYPE_REGISTRATION_HPP */ diff --git a/boost/vmd/detail/variadic_pop_front.hpp b/boost/vmd/detail/variadic_pop_front.hpp new file mode 100644 index 0000000000..97a7ca320e --- /dev/null +++ b/boost/vmd/detail/variadic_pop_front.hpp @@ -0,0 +1,24 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_DETAIL_VARIADIC_POP_FRONT_HPP) +#define BOOST_VMD_DETAIL_VARIADIC_POP_FRONT_HPP + +#include <boost/preprocessor/tuple/enum.hpp> +#include <boost/preprocessor/tuple/pop_front.hpp> +#include <boost/preprocessor/variadic/to_tuple.hpp> + +#define BOOST_VMD_DETAIL_VARIADIC_POP_FRONT(...) \ + BOOST_PP_TUPLE_ENUM \ + ( \ + BOOST_PP_TUPLE_POP_FRONT \ + ( \ + BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__) \ + ) \ + ) \ +/**/ + +#endif /* BOOST_VMD_DETAIL_VARIADIC_POP_FRONT_HPP */ diff --git a/boost/vmd/elem.hpp b/boost/vmd/elem.hpp new file mode 100644 index 0000000000..f6d575e22f --- /dev/null +++ b/boost/vmd/elem.hpp @@ -0,0 +1,292 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ELEM_HPP) +#define BOOST_VMD_ELEM_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/modifiers.hpp> +#include <boost/vmd/detail/sequence_elem.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ELEM(elem,...) + + \brief Accesses an element of a sequence. + + elem = A sequence element number. From 0 to sequence size - 1. + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to access. + Further variadic parameters are all optional. + + With no further variadic parameters the macro returns the particular element + in the sequence. If the element number is outside the bounds of the sequence + macro access fails and the macro turns emptiness. + + Optional parameters determine what it means that an element is successfully + accessed as well as what data is returned by the macro. + + Filters: specifying a VMD type tells the macro to return the element only + if it is of the VMD type specified, else macro access fails. If more than + one VMD type is specified as an optional parameter the last one + specified is the filter. + + Matching Identifiers: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, + optional parameters which are identifiers specify that the element accessed + must match one of the identifiers else access fails. The identifiers may be specified multiple + times as single optional parameters or once as a tuple of identifier + parameters. If the identifiers are specified as single optional parameters + they cannot be any of the specific BOOST_VMD_ optional parameters in order to be + recognized as matching identifiers. Normally this should never be the case. + The only situation where this could occur is if the VMD types, which are filters, + are used as matching identifiers; in this case the matching identifiers need + to be passed as a tuple of identifier parameters so they are not treated + as filters. + + Filters and matching identifiers change what it means that an element is successfully + accessed. They do not change what data is returned by the macro. The remaining optional + parameters do not change what it means that an element is successfully accessed but they + do change what data is returned by the macro. + + Splitting: Splitting allows the macro to return the rest of the sequence + after the element accessed. + + If BOOST_VMD_RETURN_AFTER is specified the return is a tuple + with the element accessed as the first tuple parameter and the rest of + the sequence as the second tuple parameter. If element access fails + both tuple parameters are empty. + + If BOOST_VMD_RETURN_ONLY_AFTER + is specified the return is the rest of the sequence after the element accessed + found. If the element access fails the return is emptiness. + + If BOOST_VMD_RETURN_NO_AFTER, the default, is specified no splitting + occurs. + + If more than one of the splitting identifiers are specified + the last one specified determines the splitting. + + Return Type: The element accessed can be changed to return both the type + of the element as well as the element data with optional return type + parameters. When a type is returned, the element accessed which is returned becomes a + two-element tuple where the type of the element accessed is the first tuple element and the element + data itself is the second tuple element. If the macro fails to access the + element the element access returned is emptiness and not a tuple. + + If BOOST_VMD_RETURN_NO_TYPE, the default, is specified no type is returned + as part of the element accessed. + + If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. + + If BOOST_VMD_RETURN_TYPE_ARRAY is specified + an array type is returned if the element is an array, else a tuple + type is returned if the element is a tuple, else the actual type + is returned for non-tuple data. + + If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple + type is returned if the element is a tuple, else the actual type + is returned for non-tuple data. + + If BOOST_VMD_RETURN_TYPE_TUPLE is specified + a tuple type is returned for all tuple-like data, else the actual type + is returned for non-tuple data. + + If more than one return type optional + parameter is specified the last one specified determines the return type. + + If a filter is specified optional return type parameters are ignored and + the default BOOST_VMD_RETURN_NO_TYPE is in effect. + + Index: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, + and matching identifiers are specified, an index parameter specifies that the + numeric index, starting with 0, of the matching identifier found, be returned + as part of the result. + + If BOOST_VMD_RETURN_INDEX is specified an index is returned + as part of the result. + + If BOOST_VMD_RETURN_NO_INDEX, the default, is specified + no index is returned as part of the result. + + If both are specified the last one specified determines the index parameter. + + When an index is returned as part of the result, the result is a tuple where the + element accessed is the first tuple parameter and the index is the last tuple parameter. + If element access fails the index is empty. If there is no BOOST_VMD_TYPE_IDENTIFIER + filter or if there are no matching identifiers the BOOST_VMD_RETURN_INDEX is ignored + and no index is returned as part of the result. + + returns = With no optional parameters the element accessed is returned, or emptiness if + element is outside the bounds of the sequence. Filters and matching identifiers + can change the meaning of whether the element accessed is returned or failure + occurs, but whenever failure occurs emptiness is returned as the element access part + of that failure, else the element accessed is returned. Return type optional parameters, + when filters are not used, return the element accessed as a two-element tuple + where the first tuple element is the type and the second tuple element is the + data; if the element is not accessed then emptiness is returned as the element access + and not a tuple. Splitting with BOOST_VMD_RETURN_AFTER returns a tuple where the element accessed + is the first tuple element and the rest of the sequence is the second tuple element. + Splitting with BOOST_VMD_RETURN_ONLY_AFTER returns the rest of the sequence after + the element accessed or emptiness if the element can not be accessed. Indexing + returns the index as part of the output only if filtering with + BOOST_VMD_TYPE_IDENTIFIER is specified and matching identifiers are specified. + When the index is returned with BOOST_VMD_RETURN_AFTER it is the third element + of the tuple returned, else it is the second element of a tuple where the element + accessed is the first element of the tuple. + +*/ + +#define BOOST_VMD_ELEM(elem,...) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM(BOOST_VMD_ALLOW_ALL,elem,__VA_ARGS__) \ +/**/ + +/** \def BOOST_VMD_ELEM_D(d,elem,...) + + \brief Accesses an element of a sequence. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + elem = A sequence element number. From 0 to sequence size - 1. + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to access. + Further variadic parameters are all optional. + + With no further variadic parameters the macro returns the particular element + in the sequence. If the element number is outside the bounds of the sequence + macro access fails and the macro turns emptiness. + + Optional parameters determine what it means that an element is successfully + accessed as well as what data is returned by the macro. + + Filters: specifying a VMD type tells the macro to return the element only + if it is of the VMD type specified, else macro access fails. If more than + one VMD type is specified as an optional parameter the last one + specified is the filter. + + Matching Identifiers: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, + optional parameters which are identifiers specify that the element accessed + must match one of the identifiers else access fails. The identifiers may be specified multiple + times as single optional parameters or once as a tuple of identifier + parameters. If the identifiers are specified as single optional parameters + they cannot be any of the specific BOOST_VMD_ optional parameters in order to be + recognized as matching identifiers. Normally this should never be the case. + The only situation where this could occur is if the VMD types, which are filters, + are used as matching identifiers; in this case the matching identifiers need + to be passed as a tuple of identifier parameters so they are not treated + as filters. + + Filters and matching identifiers change what it means that an element is successfully + accessed. They do not change what data is returned by the macro. The remaining optional + parameters do not change what it means that an element is successfully accessed but they + do change what data is returned by the macro. + + Splitting: Splitting allows the macro to return the rest of the sequence + after the element accessed. + + If BOOST_VMD_RETURN_AFTER is specified the return is a tuple + with the element accessed as the first tuple parameter and the rest of + the sequence as the second tuple parameter. If element access fails + both tuple parameters are empty. + + If BOOST_VMD_RETURN_ONLY_AFTER + is specified the return is the rest of the sequence after the element accessed + found. If the element access fails the return is emptiness. + + If BOOST_VMD_RETURN_NO_AFTER, the default, is specified no splitting + occurs. + + If more than one of the splitting identifiers are specified + the last one specified determines the splitting. + + Return Type: The element accessed can be changed to return both the type + of the element as well as the element data with optional return type + parameters. When a type is returned, the element accessed which is returned becomes a + two-element tuple where the type of the element accessed is the first tuple element and the element + data itself is the second tuple element. If the macro fails to access the + element the element access returned is emptiness and not a tuple. + + If BOOST_VMD_RETURN_NO_TYPE, the default, is specified no type is returned + as part of the element accessed. + + If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. + + If BOOST_VMD_RETURN_TYPE_ARRAY is specified + an array type is returned if the element is an array, else a tuple + type is returned if the element is a tuple, else the actual type + is returned for non-tuple data. + + If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple + type is returned if the element is a tuple, else the actual type + is returned for non-tuple data. + + If BOOST_VMD_RETURN_TYPE_TUPLE is specified + a tuple type is returned for all tuple-like data, else the actual type + is returned for non-tuple data. If more than one return type optional + parameter is specified the last one specified determines the return type. + + If a filter is specified optional return type parameters are ignored and + the default BOOST_VMD_RETURN_NO_TYPE is in effect. + + Index: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, + and matching identifiers are specified, an index parameter specifies that the + numeric index, starting with 0, of the matching identifier found, be returned + as part of the result. + + If BOOST_VMD_RETURN_INDEX is specified an index is returned + as part of the result. + + If BOOST_VMD_RETURN_NO_INDEX, the default, is specified + no index is returned as part of the result. + + If both are specified the last one specified determines the index parameter. + + When an index is returned as part of the result, the result is a tuple where the + element accessed is the first tuple parameter and the index is the last tuple parameter. + If element access fails the index is empty. If there is no BOOST_VMD_TYPE_IDENTIFIER + filter or if there are no matching identifiers the BOOST_VMD_RETURN_INDEX is ignored + and no index is returned as part of the result. + + returns = With no optional parameters the element accessed is returned, or emptiness if + element is outside the bounds of the sequence. Filters and matching identifiers + can change the meaning of whether the element accessed is returned or failure + occurs, but whenever failure occurs emptiness is returned as the element access part + of that failure, else the element accessed is returned. Return type optional parameters, + when filters are not used, return the element accessed as a two-element tuple + where the first tuple element is the type and the second tuple element is the + data; if the element is not accessed then emptiness is returned as the element access + and not a tuple. Splitting with BOOST_VMD_RETURN_AFTER returns a tuple where the element accessed + is the first tuple element and the rest of the sequence is the second tuple element. + Splitting with BOOST_VMD_RETURN_ONLY_AFTER returns the rest of the sequence after + the element accessed or emptiness if the element can not be accessed. Indexing + returns the index as part of the output only if filtering with + BOOST_VMD_TYPE_IDENTIFIER is specified and matching identifiers are specified. + When the index is returned with BOOST_VMD_RETURN_AFTER it is the third element + of the tuple returned, else it is the second element of a tuple where the element + accessed is the first element of the tuple. + +*/ + +#define BOOST_VMD_ELEM_D(d,elem,...) \ + BOOST_VMD_DETAIL_SEQUENCE_ELEM_D(d,BOOST_VMD_ALLOW_ALL,elem,__VA_ARGS__) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ELEM_HPP */ diff --git a/boost/vmd/empty.hpp b/boost/vmd/empty.hpp new file mode 100644 index 0000000000..8aaecc49c4 --- /dev/null +++ b/boost/vmd/empty.hpp @@ -0,0 +1,41 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_EMPTY_HPP) +#define BOOST_VMD_EMPTY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_EMPTY(...) + + \brief Outputs emptiness. + + ... = any variadic parameters. The parameters are ignored. + + This macro is used to output emptiness ( nothing ) no matter + what is passed to it. + + If you use this macro to return a result, as in 'result BOOST_VMD_EMPTY' + subsequently invoked, you should surround the result with + BOOST_VMD_IDENTITY_RESULT to smooth over a VC++ problem. + +*/ + +#define BOOST_VMD_EMPTY(...) + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_EMPTY_HPP */ diff --git a/boost/vmd/enum.hpp b/boost/vmd/enum.hpp new file mode 100644 index 0000000000..b08a30ae0a --- /dev/null +++ b/boost/vmd/enum.hpp @@ -0,0 +1,103 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_ENUM_HPP) +#define BOOST_VMD_ENUM_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/sequence_enum.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_ENUM(...) + + \brief Converts a sequence to comma-separated elements which are the elements of the sequence. + + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to convert. + + Further optional variadic parameters can be return type parameters. Return type + parameters allow each element in the sequence to be converted to a two-element + tuple where the first tuple element is the type and the second tuple element + is the element data. + + The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each + converted element but just the data. All of the rest return the type and data as the + two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is + returned if the element is an array, else a tuple type is returned if the element is a tuple, + else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple type is returned if the element + is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE + is specified a tuple type is returned for all tuple-like data, else the actual type is returned + for non-tuple data. If more than one return type optional parameter is specified the last one + specified determines the return type. + + returns = Comma-separated data, otherwise known as variadic data. + If the sequence is empty the variadic data is empty. If an + optional return type other than BOOST_VMD_RETURN_NO_TYPE + is specified the type and the data of each element is + returned as part of the variadic data. Otherwise just the data + of each element is returned, which is the default. + +*/ + +#define BOOST_VMD_ENUM(...) \ + BOOST_VMD_DETAIL_SEQUENCE_ENUM(__VA_ARGS__) \ +/**/ + +/** \def BOOST_VMD_ENUM_D(d,...) + + \brief Converts a sequence to comma-separated elements which are the elements of the sequence. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to convert. + + Further optional variadic parameters can be return type parameters. Return type + parameters allow each element in the sequence to be converted to a two-element + tuple where the first tuple element is the type and the second tuple element + is the element data. + + The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each + converted element but just the data. All of the rest return the type and data as the + two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is + returned if the element is an array, else a tuple type is returned if the element is a tuple, + else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple type is returned if the element + is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE + is specified a tuple type is returned for all tuple-like data, else the actual type is returned + for non-tuple data. If more than one return type optional parameter is specified the last one + specified determines the return type. + + returns = Comma-separated data, otherwise known as variadic data. + If the sequence is empty the variadic data is empty. If an + optional return type other than BOOST_VMD_RETURN_NO_TYPE + is specified the type and the data of each element is + returned as part of the variadic data. Otherwise just the data + of each element is returned, which is the default. + +*/ + +#define BOOST_VMD_ENUM_D(d,...) \ + BOOST_VMD_DETAIL_SEQUENCE_ENUM_D(d,__VA_ARGS__) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_ENUM_HPP */ diff --git a/boost/vmd/equal.hpp b/boost/vmd/equal.hpp new file mode 100644 index 0000000000..005a2d3705 --- /dev/null +++ b/boost/vmd/equal.hpp @@ -0,0 +1,89 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_EQUAL_HPP) +#define BOOST_VMD_EQUAL_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/equal.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_EQUAL(sequence,...) + + \brief Tests any two sequences for equality. + + sequence = First sequence. + ... = variadic parameters, maximum of 2. + + The first variadic parameter is required and is the second sequence to test. + The optional second variadic parameter is a VMD type as a filter. + + The macro tests any two sequences for equality. For sequences to be equal the + VMD types of each sequence must be equal and the individual elements of the + sequence must be equal. For Boost PP composite types the macro tests that + the composite types have the same size and then tests that each element + of the composite type is equal. This means that all elements of a composite + type must be a VMD type in order to use this macro successfully. + + The single optional parameter is a filter. The filter is a VMD type which specifies + that both sequences to test must be of that VMD type, as well as being equal to + each other, for the test to succeed. + + returns = 1 upon success or 0 upon failure. Success means that both sequences are + equal and, if the optional parameter is specified, that the sequences are + of the optional VMD type. + +*/ + +#define BOOST_VMD_EQUAL(sequence,...) \ + BOOST_VMD_DETAIL_EQUAL(sequence,__VA_ARGS__) \ +/**/ + +/** \def BOOST_VMD_EQUAL_D(d,sequence,...) + + \brief Tests any two sequences for equality. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + sequence = First sequence. + ... = variadic parameters, maximum of 2. + + The first variadic parameter is required and is the second sequence to test. + The optional second variadic parameter is a VMD type as a filter. + + The macro tests any two sequences for equality. For sequences to be equal the + VMD types of each sequence must be equal and the individual elements of the + sequence must be equal. For Boost PP composite types the macro tests that + the composite types have the same size and then tests that each element + of the composite type is equal. This means that all elements of a composite + type must be a VMD type in order to use this macro successfully. + + The single optional parameter is a filter. The filter is a VMD type which specifies + that both sequences to test must be of that VMD type, as well as being equal to + each other, for the test to succeed. + + returns = 1 upon success or 0 upon failure. Success means that both sequences are + equal and, if the optional parameter is specified, that the sequences are + of the optional VMD type. + +*/ + +#define BOOST_VMD_EQUAL_D(d,sequence,...) \ + BOOST_VMD_DETAIL_EQUAL_D(d,sequence,__VA_ARGS__) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_EQUAL_HPP */ diff --git a/boost/vmd/get_type.hpp b/boost/vmd/get_type.hpp new file mode 100644 index 0000000000..489e155f10 --- /dev/null +++ b/boost/vmd/get_type.hpp @@ -0,0 +1,123 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_GET_TYPE_HPP) +#define BOOST_VMD_GET_TYPE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/sequence_type.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_GET_TYPE(...) + + \brief Returns the type of a sequence as a VMD type. + + ... = variadic parameters. + + The first variadic parameter is required and is the sequence whose type we are getting. + + The optional variadic parameters are return type parameters. + + The macro returns the type of a sequence as a VMD type. The type of an empty sequence + is always BOOST_VMD_TYPE_EMPTY and the type of a multi-element is always + BOOST_VMD_TYPE_SEQUENCE. The type of a single-element sequence is the + type of that single element. + + The type returned can be modified by specifying an optional return type parameter. + + If BOOST_VMD_RETURN_TYPE, the default, is specified the specific type of the element + is returned. + + If BOOST_VMD_RETURN_TYPE_ARRAY is specified + an array type is returned if the element is an array, else a tuple + type is returned if the element is a tuple, else the actual type + is returned for non-tuple data. + + If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple + type is returned if the element is a tuple, else the actual type + is returned for non-tuple data. + + If BOOST_VMD_RETURN_TYPE_TUPLE is specified + a tuple type is returned for all tuple-like data, else the actual type + is returned for non-tuple data. + + If BOOST_VMD_RETURN_NO_TYPE is specified it is ignored since the macro + always returns the type of the sequence. + + If more than one return type optional parameter is specified the last + one specified determines the return type. + + returns = the type of the sequence as a VMD type. + +*/ + +#define BOOST_VMD_GET_TYPE(...) \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE(__VA_ARGS__) \ +/**/ + +/** \def BOOST_VMD_GET_TYPE_D(d,...) + + \brief Returns the type of a sequence as a VMD type. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + ... = variadic parameters. + + The first variadic parameter is required and is the sequence whose type we are getting. + + The optional variadic parameters are return type parameters. + + The macro returns the type of a sequence as a VMD type. The type of an empty sequence + is always BOOST_VMD_TYPE_EMPTY and the type of a multi-element is always + BOOST_VMD_TYPE_SEQUENCE. The type of a single-element sequence is the + type of that single element. + + The type returned can be modified by specifying an optional return type parameter. + + If BOOST_VMD_RETURN_TYPE, the default, is specified the specific type of the element + is returned. + + If BOOST_VMD_RETURN_TYPE_ARRAY is specified + an array type is returned if the element is an array, else a tuple + type is returned if the element is a tuple, else the actual type + is returned for non-tuple data. + + If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple + type is returned if the element is a tuple, else the actual type + is returned for non-tuple data. + + If BOOST_VMD_RETURN_TYPE_TUPLE is specified + a tuple type is returned for all tuple-like data, else the actual type + is returned for non-tuple data. + + If BOOST_VMD_RETURN_NO_TYPE is specified it is ignored since the macro + always returns the type of the sequence. + + If more than one return type optional parameter is specified the last + one specified determines the return type. + + returns = the type of the sequence as a VMD type. + +*/ + +#define BOOST_VMD_GET_TYPE_D(d,...) \ + BOOST_VMD_DETAIL_SEQUENCE_TYPE_D(d,__VA_ARGS__) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_GET_TYPE_HPP */ diff --git a/boost/vmd/identity.hpp b/boost/vmd/identity.hpp new file mode 100644 index 0000000000..870065cb02 --- /dev/null +++ b/boost/vmd/identity.hpp @@ -0,0 +1,76 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IDENTITY_HPP) +#define BOOST_VMD_IDENTITY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_MSVC +#include <boost/preprocessor/cat.hpp> +#endif +#include <boost/vmd/empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IDENTITY(item) + + \brief Macro which expands to its argument when invoked with any number of parameters. + + item = any single argument + + When BOOST_VMD_IDENTITY(item) is subsequently invoked with any number of parameters it expands + to 'item'. Subsequently invoking the macro is done as 'BOOST_VMD_IDENTITY(item)(zero_or_more_arguments)'. + + The macro is equivalent to the Boost PP macro BOOST_PP_IDENTITY(item) with the difference + being that BOOST_PP_IDENTITY(item) is always invoked with no arguments, as in + 'BOOST_VMD_IDENTITY(item)()' whereas BOOST_VMD_IDENTITY can be invoked with any number of + arguments. + + The macro is meant to be used in BOOST_PP_IF and BOOST_PP_IIF statements when only one + of the clauses needs to be invoked with calling another macro and the other is meant to + return an 'item'. + + returns = the macro as 'BOOST_VMD_IDENTITY(item)', when invoked with any number of parameters + as in '(zero_or_more_arguments)', returns 'item'. The macro itself returns + 'item BOOST_VMD_EMPTY'. + +*/ + +#define BOOST_VMD_IDENTITY(item) item BOOST_VMD_EMPTY + +/** \def BOOST_VMD_IDENTITY_RESULT(result) + + \brief Macro which wraps any result which can return its value using BOOST_VMD_IDENTITY or 'item BOOST_VMD_EMPTY'. + + result = any single result returned when BOOST_VMD_IDENTITY is used or 'item BOOST_VMD_EMPTY'. + + The reason for this macro is to smooth over a problem when using VC++ with BOOST_VMD_IDENTITY. + If your BOOST_VMD_IDENTITY macro can be used where VC++ is the compiler then you need to + surround your macro code which could return a result with this macro in order that VC++ handles + BOOST_VMD_IDENTITY correctly. + + If you are not using VC++ you do not have to use this macro, but doing so does no harm. + +*/ + +#if BOOST_VMD_MSVC +#define BOOST_VMD_IDENTITY_RESULT(result) BOOST_PP_CAT(result,) +#else +#define BOOST_VMD_IDENTITY_RESULT(result) result +#endif + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IDENTITY_HPP */ diff --git a/boost/vmd/is_array.hpp b/boost/vmd/is_array.hpp new file mode 100644 index 0000000000..fc9cf4708e --- /dev/null +++ b/boost/vmd/is_array.hpp @@ -0,0 +1,73 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_ARRAY_HPP) +#define BOOST_VMD_IS_ARRAY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/is_array.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_ARRAY(sequence) + + \brief Determines if a sequence is a Boost PP array. + + The macro checks that the sequence is a Boost PP array. + It returns 1 if it is an array, else if returns 0. + + sequence = a possible Boost PP array. + + returns = 1 if it is an array, else returns 0. + + The macro will generate a preprocessing error if the input + is in the form of an array but its first tuple element, instead + of being a number, is a preprocessor token which VMD cannot parse, + as in the example '(&2,(0,1))' which is a valid tuple but an invalid + array. + +*/ + +#define BOOST_VMD_IS_ARRAY(sequence) \ + BOOST_VMD_DETAIL_IS_ARRAY(sequence) \ +/**/ + +/** \def BOOST_VMD_IS_ARRAY_D(d,sequence) + + \brief Determines if a sequence is a Boost PP array. Re-entrant version. + + The macro checks that the sequence is a Boost PP array. + It returns 1 if it is an array, else if returns 0. + + d = The next available BOOST_PP_WHILE iteration. + sequence = a possible Boost PP array. + + returns = 1 if it is an array, else returns 0. + + The macro will generate a preprocessing error if the input + is in the form of an array but its first tuple element, instead + of being a number, is a preprocessor token which VMD cannot parse, + as in the example '(&2,(0,1))' which is a valid tuple but an invalid + array. + +*/ + +#define BOOST_VMD_IS_ARRAY_D(d,sequence) \ + BOOST_VMD_DETAIL_IS_ARRAY_D(d,sequence) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_ARRAY_HPP */ diff --git a/boost/vmd/is_empty.hpp b/boost/vmd/is_empty.hpp new file mode 100644 index 0000000000..951c98bf6d --- /dev/null +++ b/boost/vmd/is_empty.hpp @@ -0,0 +1,95 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_EMPTY_HPP) +#define BOOST_VMD_IS_EMPTY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/vmd/detail/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_EMPTY(...) + + \brief Tests whether its input is empty or not. + + The macro checks to see if the input is empty or not. + It returns 1 if the input is empty, else returns 0. + + The macro is a variadic macro taking any input. + For the VC++8 compiler (VS2005) the macro takes a single parameter of input to check. + + The macro is not perfect, and can not be so. The problem + area is if the input to be checked is a function-like + macro name, in which case either a compiler error can result + or a false result can occur. + + This macro is a replacement, using variadic macro support, + for the undocumented macro BOOST_PP_IS_EMPTY in the Boost + PP library. The code is taken from a posting by Paul Mensonides + of a variadic version for BOOST_PP_IS_EMPTY, and changed + in order to also support VC++. + + .... = variadic input, for VC++8 this must be a single parameter + + returns = 1 if the input is empty, 0 if it is not + + It is recommended to append BOOST_PP_EMPTY() to whatever input + is being tested in order to avoid possible warning messages + from some compilers about no parameters being passed to the macro + when the input is truly empty. + +*/ + +#if BOOST_VMD_MSVC_V8 + +#define BOOST_VMD_IS_EMPTY(sequence) \ + BOOST_VMD_DETAIL_IS_EMPTY_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS \ + ( \ + sequence \ + ) \ + ) \ + ( \ + BOOST_VMD_DETAIL_IS_EMPTY_GEN_ZERO, \ + BOOST_VMD_DETAIL_IS_EMPTY_PROCESS \ + ) \ + (sequence) \ +/**/ + +#else + +#define BOOST_VMD_IS_EMPTY(...) \ + BOOST_VMD_DETAIL_IS_EMPTY_IIF \ + ( \ + BOOST_PP_IS_BEGIN_PARENS \ + ( \ + __VA_ARGS__ \ + ) \ + ) \ + ( \ + BOOST_VMD_DETAIL_IS_EMPTY_GEN_ZERO, \ + BOOST_VMD_DETAIL_IS_EMPTY_PROCESS \ + ) \ + (__VA_ARGS__) \ +/**/ + +#endif /* BOOST_VMD_MSVC_V8 */ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_EMPTY_HPP */ diff --git a/boost/vmd/is_empty_array.hpp b/boost/vmd/is_empty_array.hpp new file mode 100644 index 0000000000..913af70db9 --- /dev/null +++ b/boost/vmd/is_empty_array.hpp @@ -0,0 +1,98 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_EMPTY_ARRAY_HPP) +#define BOOST_VMD_IS_EMPTY_ARRAY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/vmd/is_array.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/detail/is_empty_array.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_EMPTY_ARRAY(sequence) + + \brief Tests whether a sequence is an empty Boost PP array. + + An empty Boost PP array is a two element tuple where the first + size element is 0 and the second element is a tuple with a single + empty element, ie. '(0,())'. + + sequence = a possible empty array + + returns = 1 if the sequence is an empty Boost PP array + 0 if it is not. + + The macro will generate a preprocessing error if the sequence + is in the form of an array but its first tuple element, instead + of being a number, is a preprocessor token which VMD cannot parse, + as in the example '(&0,())' which is a valid tuple but an invalid + array. + +*/ + +#define BOOST_VMD_IS_EMPTY_ARRAY(sequence) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_ARRAY(sequence), \ + BOOST_VMD_DETAIL_IS_EMPTY_ARRAY_SIZE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (sequence) \ + ) \ +/**/ + +/** \def BOOST_VMD_IS_EMPTY_ARRAY_D(d,sequence) + + \brief Tests whether a sequence is an empty Boost PP array. Re-entrant version. + + An empty Boost PP array is a two element tuple where the first + size element is 0 and the second element is a tuple with a single + empty element, ie. '(0,())'. + + d = The next available BOOST_PP_WHILE iteration. + sequence = a possible empty array + + returns = 1 if the sequence is an empty Boost PP array + 0 if it is not. + + The macro will generate a preprocessing error if the sequence + is in the form of an array but its first tuple element, instead + of being a number, is a preprocessor token which VMD cannot parse, + as in the example '(&0,())' which is a valid tuple but an invalid + array. + +*/ + +#define BOOST_VMD_IS_EMPTY_ARRAY_D(d,sequence) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_ARRAY_D(d,sequence), \ + BOOST_VMD_DETAIL_IS_EMPTY_ARRAY_SIZE, \ + BOOST_VMD_IDENTITY(0) \ + ) \ + (sequence) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_EMPTY_ARRAY_HPP */ diff --git a/boost/vmd/is_empty_list.hpp b/boost/vmd/is_empty_list.hpp new file mode 100644 index 0000000000..cad73a591e --- /dev/null +++ b/boost/vmd/is_empty_list.hpp @@ -0,0 +1,73 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_EMPTY_LIST_HPP) +#define BOOST_VMD_IS_EMPTY_LIST_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/is_list.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_EMPTY_LIST(sequence) + + \brief Tests whether a sequence is an empty Boost PP list. + + An empty Boost PP list consists of the single identifier 'BOOST_PP_NIL'. + This identifier also serves as a list terminator for a non-empty list. + + sequence = a preprocessor parameter + + returns = 1 if the sequence is an empty Boost PP list + 0 if it is not. + + The macro will generate a preprocessing error if the input + as an empty list marker, instead of being an identifier, is + a preprocessor token which VMD cannot parse, as in the + example '&BOOST_PP_NIL'. + +*/ + +#define BOOST_VMD_IS_EMPTY_LIST(sequence) \ + BOOST_VMD_DETAIL_IS_LIST_IS_EMPTY_LIST_PROCESS(sequence) \ +/**/ + +/** \def BOOST_VMD_IS_EMPTY_LIST_D(d,sequence) + + \brief Tests whether a sequence is an empty Boost PP list. Re-entrant version. + + An empty Boost PP list consists of the single identifier 'BOOST_PP_NIL'. + This identifier also serves as a list terminator for a non-empty list. + + d = The next available BOOST_PP_WHILE iteration + sequence = a preprocessor parameter + + returns = 1 if the sequence is an empty Boost PP list + 0 if it is not. + + The macro will generate a preprocessing error if the input + as an empty list marker, instead of being an identifier, is + a preprocessor token which VMD cannot parse, as in the + example '&BOOST_PP_NIL'. + +*/ + +#define BOOST_VMD_IS_EMPTY_LIST_D(d,sequence) \ + BOOST_VMD_DETAIL_IS_LIST_IS_EMPTY_LIST_PROCESS_D(d,sequence) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_EMPTY_LIST_HPP */ diff --git a/boost/vmd/is_identifier.hpp b/boost/vmd/is_identifier.hpp new file mode 100644 index 0000000000..b41b1b4eed --- /dev/null +++ b/boost/vmd/is_identifier.hpp @@ -0,0 +1,117 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_IDENTIFIER_HPP) +#define BOOST_VMD_IS_IDENTIFIER_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/is_identifier.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_IDENTIFIER(...) + + \brief Tests whether a parameter is an identifier. + + ... = variadic parameters + + The first variadic parameter is required and it is the input to test. + + Further variadic parameters are optional and are identifiers to match. + The data may take one of two forms; it is either one or more single identifiers + or a single Boost PP tuple of identifiers. + + returns = 1 if the parameter is an identifier, otherwise 0. + + If the parameter is not an identifier, + or if optional identifiers are specified and the identifier + does not match any of the optional identifiers, the macro returns 0. + + Identifiers are registered in VMD with: + + #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. + + The identifier must be registered to be found. + + Identifiers are pre-detected in VMD with: + + #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. + + If you specify optional identifiers and have not specified the detection + of an optional identifier, that optional identifier will never match the input. + + If the input is not a VMD data type this macro could lead to + a preprocessor error. This is because the macro + uses preprocessor concatenation to determine if the input + is an identifier once it is determined that the input does not + start with parenthesis. If the data being concatenated would + lead to an invalid preprocessor token the compiler can issue + a preprocessor error. + +*/ + +#define BOOST_VMD_IS_IDENTIFIER(...) \ + BOOST_VMD_DETAIL_IS_IDENTIFIER(__VA_ARGS__) \ +/**/ + +/** \def BOOST_VMD_IS_IDENTIFIER_D(d,...) + + \brief Tests whether a parameter is an identifier. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + ... = variadic parameters + + The first variadic parameter is required and it is the input to test. + + Further variadic parameters are optional and are identifiers to match. + The data may take one of two forms; it is either one or more single identifiers + or a single Boost PP tuple of identifiers. + + returns = 1 if the parameter is an identifier, otherwise 0. + + If the parameter is not an identifier, + or if optional identifiers are specified and the identifier + does not match any of the optional identifiers, the macro returns 0. + + Identifiers are registered in VMD with: + + #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. + + The identifier must be registered to be found. + + Identifiers are pre-detected in VMD with: + + #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. + + If you specify optional identifiers and have not specified the detection + of an optional identifier, that optional identifier will never match the input. + + If the input is not a VMD data type this macro could lead to + a preprocessor error. This is because the macro + uses preprocessor concatenation to determine if the input + is an identifier once it is determined that the input does not + start with parenthesis. If the data being concatenated would + lead to an invalid preprocessor token the compiler can issue + a preprocessor error. + +*/ + +#define BOOST_VMD_IS_IDENTIFIER_D(d,...) \ + BOOST_VMD_DETAIL_IS_IDENTIFIER_D(d,__VA_ARGS__) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_IDENTIFIER_HPP */ diff --git a/boost/vmd/is_list.hpp b/boost/vmd/is_list.hpp new file mode 100644 index 0000000000..986872b4fc --- /dev/null +++ b/boost/vmd/is_list.hpp @@ -0,0 +1,73 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_LIST_HPP) +#define BOOST_VMD_IS_LIST_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/is_list.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_LIST(sequence) + + \brief Determines if a sequence is a Boost pplib list. + + The macro checks that the sequence is a pplib list. + It returns 1 if it is a list, else if returns 0. + + sequence = input as a possible Boost PP list. + + returns = 1 if it a list, else returns 0. + + The macro will generate a preprocessing error if the input + is in the form of a list but its end-of-list marker, instead + of being an identifier, is a preprocessor token which VMD cannot parse, + as in the example '(anything,&BOOST_PP_NIL)' which is a valid tuple but + an invalid list. + +*/ + +#define BOOST_VMD_IS_LIST(sequence) \ + BOOST_VMD_DETAIL_IS_LIST(sequence) \ +/**/ + +/** \def BOOST_VMD_IS_LIST_D(d,sequence) + + \brief Determines if a sequence is a Boost pplib list. Re-entrant version. + + The macro checks that the sequence is a pplib list. + It returns 1 if it is a list, else if returns 0. + + d = The next available BOOST_PP_WHILE iteration. + sequence = input as a possible Boost PP list. + + returns = 1 if it a list, else returns 0. + + The macro will generate a preprocessing error if the input + is in the form of a list but its end-of-list marker, instead + of being an identifier, is a preprocessor token which VMD cannot parse, + as in the example '(anything,&BOOST_PP_NIL)' which is a valid tuple but + an invalid list. + +*/ + +#define BOOST_VMD_IS_LIST_D(d,sequence) \ + BOOST_VMD_DETAIL_IS_LIST_D(d,sequence) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_LIST_HPP */ diff --git a/boost/vmd/is_multi.hpp b/boost/vmd/is_multi.hpp new file mode 100644 index 0000000000..d080837167 --- /dev/null +++ b/boost/vmd/is_multi.hpp @@ -0,0 +1,67 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_MULTI_HPP) +#define BOOST_VMD_IS_MULTI_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/sequence_arity.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_MULTI(sequence) + + \brief Determines if the sequence has more than one element, referred to as a multi-element sequence. + + sequence = a sequence + + returns = 1 if the sequence is a multi-element sequence, else returns 0. + + If the size of a sequence is known it is faster comparing that size to be greater + than one to find out if the sequence is multi-element. But if the size of the + sequence is not known it is faster calling this macro than getting the size and + doing the previously mentioned comparison in order to determine if the sequence + is multi-element or not. + +*/ + +#define BOOST_VMD_IS_MULTI(sequence) \ + BOOST_VMD_DETAIL_IS_MULTI(sequence) \ +/**/ + +/** \def BOOST_VMD_IS_MULTI_D(d,sequence) + + \brief Determines if the sequence has more than one element, referred to as a multi-element sequence. + + d = The next available BOOST_PP_WHILE iteration. + sequence = a sequence + + returns = 1 if the sequence is a multi-element sequence, else returns 0. + + If the size of a sequence is known it is faster comparing that size to be greater + than one to find out if the sequence is multi-element. But if the size of the + sequence is not known it is faster calling this macro than getting the size and + doing the previously mentioned comparison in order to determine if the sequence + is multi-element or not. + +*/ + +#define BOOST_VMD_IS_MULTI_D(d,sequence) \ + BOOST_VMD_DETAIL_IS_MULTI_D(d,sequence) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_MULTI_HPP */ diff --git a/boost/vmd/is_number.hpp b/boost/vmd/is_number.hpp new file mode 100644 index 0000000000..7bc66fa4f6 --- /dev/null +++ b/boost/vmd/is_number.hpp @@ -0,0 +1,52 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_NUMBER_HPP) +#define BOOST_VMD_IS_NUMBER_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/is_number.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_NUMBER(sequence) + + \brief Tests whether a sequence is a Boost PP number. + + The macro checks to see if a sequence is a Boost PP number. + A Boost PP number is a value from 0 to 256. + + sequence = a possible number + + returns = 1 if the sequence is a Boost PP number, + 0 if it is not. + + If the input is not a VMD data type this macro could lead to + a preprocessor error. This is because the macro + uses preprocessor concatenation to determine if the input + is a number once it is determined that the input does not + start with parenthesis. If the data being concatenated would + lead to an invalid preprocessor token the compiler can issue + a preprocessor error. + +*/ + +#define BOOST_VMD_IS_NUMBER(sequence) \ + BOOST_VMD_DETAIL_IS_NUMBER(sequence) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_NUMBER_HPP */ diff --git a/boost/vmd/is_parens_empty.hpp b/boost/vmd/is_parens_empty.hpp new file mode 100644 index 0000000000..dad7bafecb --- /dev/null +++ b/boost/vmd/is_parens_empty.hpp @@ -0,0 +1,73 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_PARENS_EMPTY_HPP) +#define BOOST_VMD_IS_PARENS_EMPTY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/is_empty_tuple.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_PARENS_EMPTY(sequence) + + \brief Determines if the sequence is a set of parens with no data. + + sequence = a VMD sequence + + returns = 1 if the sequence is a set of parens with no data, + else returns 0. + + A set of parens with no data may be: + + 1) a tuple whose size is a single element which is empty + + or + + 2) a single element seq whose data is empty + +*/ + +#define BOOST_VMD_IS_PARENS_EMPTY(sequence) \ + BOOST_VMD_DETAIL_IS_EMPTY_TUPLE(sequence) \ +/**/ + +/** \def BOOST_VMD_IS_PARENS_EMPTY_D(d,sequence) + + \brief Determines if the sequence is a set of parens with no data. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + sequence = a VMD sequence + + returns = 1 if the sequence is a set of parens with no data, + else returns 0. + + A set of parens with no data may be: + + 1) a tuple whose size is a single element which is empty + + or + + 2) a single element seq whose data is empty + +*/ + +#define BOOST_VMD_IS_PARENS_EMPTY_D(d,sequence) \ + BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_D(d,sequence) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_PARENS_EMPTY_HPP */ diff --git a/boost/vmd/is_seq.hpp b/boost/vmd/is_seq.hpp new file mode 100644 index 0000000000..3bf4f203c5 --- /dev/null +++ b/boost/vmd/is_seq.hpp @@ -0,0 +1,71 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_SEQ_HPP) +#define BOOST_VMD_IS_SEQ_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/is_seq.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_SEQ(sequence) + + \brief Determines if a sequence is a Boost PP seq. + + The macro checks that the sequence is a Boost PP seq. + It returns 1 if it is a seq, else if returns 0. + + sequence = a possible Boost PP seq + + returns = 1 if it a seq, else returns 0. + + A single set of parentheses, with a single element, + is parsed as a tuple and not a seq. To be parsed as + a seq the input needs to be more than one consecutive + sets of parentheses, each with a single element of data. + +*/ + +#define BOOST_VMD_IS_SEQ(sequence) \ + BOOST_VMD_DETAIL_IS_SEQ(sequence) \ +/**/ + +/** \def BOOST_VMD_IS_SEQ_D(d,sequence) + + \brief Determines if a sequence is a Boost PP seq. Re-entrant version. + + The macro checks that the sequence is a Boost PP seq. + It returns 1 if it is a seq, else if returns 0. + + d = The next available BOOST_PP_WHILE iteration. + sequence = a possible Boost PP seq + + returns = 1 if it a seq, else returns 0. + + A single set of parentheses, with a single element, + is parsed as a tuple and not a seq. To be parsed as + a seq the input needs to be more than one consecutive + sets of parentheses, each with a single element of data. + +*/ + +#define BOOST_VMD_IS_SEQ_D(d,sequence) \ + BOOST_VMD_DETAIL_IS_SEQ_D(d,sequence) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_SEQ_HPP */ diff --git a/boost/vmd/is_tuple.hpp b/boost/vmd/is_tuple.hpp new file mode 100644 index 0000000000..2f7d0436db --- /dev/null +++ b/boost/vmd/is_tuple.hpp @@ -0,0 +1,45 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_TUPLE_HPP) +#define BOOST_VMD_IS_TUPLE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/is_tuple.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_TUPLE(sequence) + + \brief Tests whether a sequence is a Boost PP tuple. + + The macro checks to see if a sequence is a Boost PP tuple. + A Boost PP tuple is preprocessor tokens enclosed by a set of parentheses + with no preprocessing tokens before or after the parentheses. + + sequence = a possible tuple + + returns = 1 if the sequence is a Boost PP tuple. + 0 if it is not. + +*/ + +#define BOOST_VMD_IS_TUPLE(sequence) \ + BOOST_VMD_DETAIL_IS_TUPLE(sequence) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_TUPLE_HPP */ diff --git a/boost/vmd/is_type.hpp b/boost/vmd/is_type.hpp new file mode 100644 index 0000000000..8ddfdcd033 --- /dev/null +++ b/boost/vmd/is_type.hpp @@ -0,0 +1,73 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_TYPE_HPP) +#define BOOST_VMD_IS_TYPE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/is_type.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_TYPE(sequence) + + \brief Tests whether a sequence is a VMD type. + + sequence = a possible VMD type + + returns = 1 if the sequence is a VMD type, + 0 if it is not. + + If the sequence is not a VMD data type this macro could lead to + a preprocessor error. This is because the macro + uses preprocessor concatenation to determine if the sequence + is an identifier once it is determined that the sequence does not + start with parentheses. If the data being concatenated would + lead to an invalid preprocessor token the compiler can issue + a preprocessor error. + +*/ + +#define BOOST_VMD_IS_TYPE(sequence) \ + BOOST_VMD_DETAIL_IS_TYPE(sequence) \ +/**/ + +/** \def BOOST_VMD_IS_TYPE_D(d,sequence) + + \brief Tests whether a sequence is a VMD type. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + sequence = a possible VMD type + + returns = 1 if the sequence is a VMD type, + 0 if it is not. + + If the sequence is not a VMD data type this macro could lead to + a preprocessor error. This is because the macro + uses preprocessor concatenation to determine if the sequence + is an identifier once it is determined that the sequence does not + start with parentheses. If the data being concatenated would + lead to an invalid preprocessor token the compiler can issue + a preprocessor error. + +*/ + +#define BOOST_VMD_IS_TYPE_D(d,sequence) \ + BOOST_VMD_DETAIL_IS_TYPE_D(d,sequence) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_TYPE_HPP */ diff --git a/boost/vmd/is_unary.hpp b/boost/vmd/is_unary.hpp new file mode 100644 index 0000000000..1f44c19bfd --- /dev/null +++ b/boost/vmd/is_unary.hpp @@ -0,0 +1,67 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_UNARY_HPP) +#define BOOST_VMD_IS_UNARY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/sequence_arity.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_UNARY(sequence) + + \brief Determines if the sequence has only a single element, referred to as a single-element sequence. + + sequence = a VMD sequence + + returns = 1 if the sequence is a single-element sequence, else returns 0. + + If the size of a sequence is known it is faster comparing that size to be equal + to one to find out if the sequence is single-element. But if the size of the + sequence is not known it is faster calling this macro than getting the size and + doing the previously mentioned comparison in order to determine if the sequence + is single-element or not. + +*/ + +#define BOOST_VMD_IS_UNARY(sequence) \ + BOOST_VMD_DETAIL_IS_UNARY(sequence) \ +/**/ + +/** \def BOOST_VMD_IS_UNARY_D(d,sequence) + + \brief Determines if the sequence has only a single element, referred to as a single-element sequence. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + sequence = a sequence + + returns = 1 if the sequence is a single-element sequence, else returns 0. + + If the size of a sequence is known it is faster comparing that size to be equal + to one to find out if the sequence is single-element. But if the size of the + sequence is not known it is faster calling this macro than getting the size and + doing the previously mentioned comparison in order to determine if the sequence + is single-element or not. + +*/ + +#define BOOST_VMD_IS_UNARY_D(d,sequence) \ + BOOST_VMD_DETAIL_IS_UNARY_D(d,sequence) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_UNARY_HPP */ diff --git a/boost/vmd/list.hpp b/boost/vmd/list.hpp new file mode 100644 index 0000000000..9a80a60ff4 --- /dev/null +++ b/boost/vmd/list.hpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_LIST_HPP) +#define BOOST_VMD_LIST_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/list/to_seq.hpp> +#include <boost/vmd/list/to_tuple.hpp> + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_LIST_HPP */ diff --git a/boost/vmd/list/to_seq.hpp b/boost/vmd/list/to_seq.hpp new file mode 100644 index 0000000000..a53e8407c5 --- /dev/null +++ b/boost/vmd/list/to_seq.hpp @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_LIST_TO_SEQ_HPP) +#define BOOST_VMD_LIST_TO_SEQ_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/list/to_seq.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/is_empty_list.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_LIST_TO_SEQ(list) + + \brief converts a list to a seq. + + list = list to be converted. + + If the list is an empty list (BOOST_PP_NIL) it is converted to an empty seq. + Otherwise the list is converted to a seq with the same number of elements as the list. +*/ + +#define BOOST_VMD_LIST_TO_SEQ(list) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY_LIST(list), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_LIST_TO_SEQ \ + ) \ + (list) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_LIST_TO_SEQ_HPP */ diff --git a/boost/vmd/list/to_tuple.hpp b/boost/vmd/list/to_tuple.hpp new file mode 100644 index 0000000000..ddcd2069c1 --- /dev/null +++ b/boost/vmd/list/to_tuple.hpp @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_LIST_TO_TUPLE_HPP) +#define BOOST_VMD_LIST_TO_TUPLE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/list/to_tuple.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/is_empty_list.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_LIST_TO_TUPLE(list) + + \brief converts a list to a tuple. + + list = list to be converted. + + If the list is an empty list (BOOST_PP_NIL) it is converted to an empty tuple. + Otherwise the list is converted to a tuple with the same number of elements as the list. +*/ + +#define BOOST_VMD_LIST_TO_TUPLE(list) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY_LIST(list), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_LIST_TO_TUPLE \ + ) \ + (list) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_LIST_TO_TUPLE_HPP */ diff --git a/boost/vmd/not_equal.hpp b/boost/vmd/not_equal.hpp new file mode 100644 index 0000000000..2480cdc00a --- /dev/null +++ b/boost/vmd/not_equal.hpp @@ -0,0 +1,94 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_NOT_EQUAL_HPP) +#define BOOST_VMD_NOT_EQUAL_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/logical/compl.hpp> +#include <boost/vmd/equal.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_NOT_EQUAL(sequence,...) + + \brief Tests any two sequences for inequality. + + sequence = First sequence. + ... = variadic parameters, maximum of 2. + + The first variadic parameter is required and is the second sequence to test. + The optional second variadic parameter is a VMD type as a filter. + + The macro tests any two sequences for inequality. For sequences to be unequal + either the VMD types of each sequence must be unequal or the individual elements of the + sequence must be unequal. + + The single optional parameter is a filter. The filter is a VMD type which specifies + that both sequences to test must be of that VMD type, as well as being equal to + each other, for the test to fail, else it succeeds. + + returns = 1 upon success or 0 upon failure. Success means that the sequences are + unequal or, if the optional parameter is specified, that the sequences are + not of the optional VMD type; otherwise 0 is returned if the sequences + are equal. + + The macro is implemented as the complement of BOOST_VMD_EQUAL, so that whenever + BOOST_VMD_EQUAL would return 1 the macro returns 0 and whenever BOOST_VMD_EQUAL + would return 0 the macro would return 1. + +*/ + +#define BOOST_VMD_NOT_EQUAL(sequence,...) \ + BOOST_PP_COMPL(BOOST_VMD_EQUAL(sequence,__VA_ARGS__)) \ +/**/ + +/** \def BOOST_VMD_NOT_EQUAL_D(d,sequence,...) + + \brief Tests any two sequences for inequality. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + sequence = First sequence. + ... = variadic parameters, maximum of 2. + + The first variadic parameter is required and is the second sequence to test. + The optional second variadic parameter is a VMD type as a filter. + + The macro tests any two sequences for inequality. For sequences to be unequal + either the VMD types of each sequence must be unequal or the individual elements of the + sequence must be unequal. + + The single optional parameter is a filter. The filter is a VMD type which specifies + that both sequences to test must be of that VMD type, as well as being equal to + each other, for the test to fail, else it succeeds. + + returns = 1 upon success or 0 upon failure. Success means that the sequences are + unequal or, if the optional parameter is specified, that the sequences are + not of the optional VMD type; otherwise 0 is returned if the sequences + are equal. + + The macro is implemented as the complement of BOOST_VMD_EQUAL, so that whenever + BOOST_VMD_EQUAL would return 1 the macro returns 0 and whenever BOOST_VMD_EQUAL + would return 0 the macro would return 1. + +*/ + +#define BOOST_VMD_NOT_EQUAL_D(d,sequence,...) \ + BOOST_PP_COMPL(BOOST_VMD_EQUAL_D(d,sequence,__VA_ARGS__)) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_NOT_EQUAL_HPP */ diff --git a/boost/vmd/seq.hpp b/boost/vmd/seq.hpp new file mode 100644 index 0000000000..5a09759894 --- /dev/null +++ b/boost/vmd/seq.hpp @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_SEQ_HPP) +#define BOOST_VMD_SEQ_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/seq/is_vmd_seq.hpp> +#include <boost/vmd/seq/pop_back.hpp> +#include <boost/vmd/seq/pop_front.hpp> +#include <boost/vmd/seq/push_back.hpp> +#include <boost/vmd/seq/push_front.hpp> +#include <boost/vmd/seq/remove.hpp> +#include <boost/vmd/seq/size.hpp> +#include <boost/vmd/seq/to_array.hpp> +#include <boost/vmd/seq/to_list.hpp> +#include <boost/vmd/seq/to_tuple.hpp> + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_SEQ_HPP */ diff --git a/boost/vmd/seq/is_vmd_seq.hpp b/boost/vmd/seq/is_vmd_seq.hpp new file mode 100644 index 0000000000..38648d2fd0 --- /dev/null +++ b/boost/vmd/seq/is_vmd_seq.hpp @@ -0,0 +1,56 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_VMD_SEQ_HPP) +#define BOOST_VMD_IS_VMD_SEQ_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_seq.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_VMD_SEQ(sequence) + + \brief Determines if a sequence is a VMD seq. + + The macro checks that the sequence is a VMD seq. + A VMD seq, which may be a Boost PP seq or emptiness, is a superset of a Boost PP seq. + It returns 1 if it is a VMD seq, else if returns 0. + + sequence = a possible Boost PP seq + + returns = 1 if it a VMD seq, else returns 0. + +*/ + +#define BOOST_VMD_IS_VMD_SEQ(sequence) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(sequence), \ + BOOST_VMD_IDENTITY(1), \ + BOOST_VMD_IS_SEQ \ + ) \ + (sequence) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_VMD_SEQ_HPP */ diff --git a/boost/vmd/seq/pop_back.hpp b/boost/vmd/seq/pop_back.hpp new file mode 100644 index 0000000000..5e3865a552 --- /dev/null +++ b/boost/vmd/seq/pop_back.hpp @@ -0,0 +1,51 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_SEQ_POP_BACK_HPP) +#define BOOST_VMD_SEQ_POP_BACK_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/seq/pop_back.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/vmd/empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_SEQ_POP_BACK(seq) + + \brief pops an element from the end of a seq. + + seq = seq to pop an element from. + + If the seq is an empty seq the result is undefined. + If the seq is a single element the result is an empty seq. + Otherwise the result is a seq after removing the last element. +*/ + +#define BOOST_VMD_SEQ_POP_BACK(seq) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(BOOST_PP_SEQ_SIZE(seq),1), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_SEQ_POP_BACK \ + ) \ + (seq) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_SEQ_POP_BACK_HPP */ diff --git a/boost/vmd/seq/pop_front.hpp b/boost/vmd/seq/pop_front.hpp new file mode 100644 index 0000000000..782c75e956 --- /dev/null +++ b/boost/vmd/seq/pop_front.hpp @@ -0,0 +1,51 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_SEQ_POP_FRONT_HPP) +#define BOOST_VMD_SEQ_POP_FRONT_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/seq/pop_front.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/vmd/empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_SEQ_POP_FRONT(seq) + + \brief pops an element from the front of a seq. + + seq = seq to pop an element from. + + If the seq is an empty seq the result is undefined. + If the seq is a single element the result is an empty seq. + Otherwise the result is a seq after removing the first element. +*/ + +#define BOOST_VMD_SEQ_POP_FRONT(seq) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(BOOST_PP_SEQ_SIZE(seq),1), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_SEQ_POP_FRONT \ + ) \ + (seq) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_SEQ_POP_FRONT_HPP */ diff --git a/boost/vmd/seq/push_back.hpp b/boost/vmd/seq/push_back.hpp new file mode 100644 index 0000000000..862fc791fa --- /dev/null +++ b/boost/vmd/seq/push_back.hpp @@ -0,0 +1,53 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_SEQ_PUSH_BACK_HPP) +#define BOOST_VMD_SEQ_PUSH_BACK_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/seq/push_back.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_SEQ_PUSH_BACK(seq,elem) + + \brief appends an element to the end of a seq. + + seq = seq to to append an element to. + elem = element to append. + + If the seq is an empty seq the result is a seq with the single element. + Otherwise the result is a seq after adding the element to the end. +*/ + +#define BOOST_VMD_SEQ_PUSH_BACK(seq,elem) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(seq), \ + BOOST_VMD_IDENTITY((elem)), \ + BOOST_PP_SEQ_PUSH_BACK \ + ) \ + (seq,elem) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_SEQ_PUSH_BACK_HPP */ diff --git a/boost/vmd/seq/push_front.hpp b/boost/vmd/seq/push_front.hpp new file mode 100644 index 0000000000..33b2683526 --- /dev/null +++ b/boost/vmd/seq/push_front.hpp @@ -0,0 +1,53 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_SEQ_PUSH_FRONT_HPP) +#define BOOST_VMD_SEQ_PUSH_FRONT_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/seq/push_front.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_SEQ_PUSH_FRONT(seq,elem) + + \brief inserts an element at the beginning of a seq. + + seq = seq to insert an element at. + elem = element to insert. + + If the seq is an empty seq the result is a seq with the single element. + Otherwise the result is a seq after inserting the element at the beginning. +*/ + +#define BOOST_VMD_SEQ_PUSH_FRONT(seq,elem) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(seq), \ + BOOST_VMD_IDENTITY((elem)), \ + BOOST_PP_SEQ_PUSH_FRONT \ + ) \ + (seq,elem) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_SEQ_PUSH_FRONT_HPP */ diff --git a/boost/vmd/seq/remove.hpp b/boost/vmd/seq/remove.hpp new file mode 100644 index 0000000000..11a7a7ec4c --- /dev/null +++ b/boost/vmd/seq/remove.hpp @@ -0,0 +1,57 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_SEQ_REMOVE_HPP) +#define BOOST_VMD_SEQ_REMOVE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/logical/bitand.hpp> +#include <boost/preprocessor/seq/remove.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/vmd/empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_SEQ_REMOVE(seq,index) + + \brief removes an element from a seq. + + seq = seq from which an element is to be removed. + index = The zero-based position in seq of the element to be removed. + + If index is greater or equal to the seq size the result is undefined. + If the seq is a single element and the index is 0 the result is an empty seq. + Otherwise the result is a seq after removing the index element. +*/ + +#define BOOST_VMD_SEQ_REMOVE(seq,index) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_PP_EQUAL(index,0), \ + BOOST_PP_EQUAL(BOOST_PP_SEQ_SIZE(seq),1) \ + ), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_SEQ_REMOVE \ + ) \ + (seq,index) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_SEQ_REMOVE_HPP */ diff --git a/boost/vmd/seq/size.hpp b/boost/vmd/seq/size.hpp new file mode 100644 index 0000000000..0deef78db9 --- /dev/null +++ b/boost/vmd/seq/size.hpp @@ -0,0 +1,52 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_SEQ_SIZE_HPP) +#define BOOST_VMD_SEQ_SIZE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_SEQ_SIZE(seq) + + \brief expands to the size of the seq passed to it. + + seq = seq whose size is to be extracted. + + If the seq is an empty seq its size is 0. + Otherwise the result is the number of elements in the seq. +*/ + +#define BOOST_VMD_SEQ_SIZE(seq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(seq), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_PP_SEQ_SIZE \ + ) \ + (seq) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_SEQ_SIZE_HPP */ diff --git a/boost/vmd/seq/to_array.hpp b/boost/vmd/seq/to_array.hpp new file mode 100644 index 0000000000..37b42f79e7 --- /dev/null +++ b/boost/vmd/seq/to_array.hpp @@ -0,0 +1,52 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_SEQ_TO_ARRAY_HPP) +#define BOOST_VMD_SEQ_TO_ARRAY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/seq/to_array.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_SEQ_TO_ARRAY(seq) + + \brief converts a seq to an array. + + seq = seq to be converted. + + If the seq is an empty seq it is converted to an array with 0 elements. + Otherwise the seq is converted to an array with the same number of elements as the seq. +*/ + +#define BOOST_VMD_SEQ_TO_ARRAY(seq) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(seq), \ + BOOST_VMD_IDENTITY((0,())), \ + BOOST_PP_SEQ_TO_ARRAY \ + ) \ + (seq) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_SEQ_TO_ARRAY_HPP */ diff --git a/boost/vmd/seq/to_list.hpp b/boost/vmd/seq/to_list.hpp new file mode 100644 index 0000000000..129f7b857f --- /dev/null +++ b/boost/vmd/seq/to_list.hpp @@ -0,0 +1,65 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_SEQ_TO_LIST_HPP) +#define BOOST_VMD_SEQ_TO_LIST_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/seq/to_list.hpp> +// #include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_SEQ_TO_LIST(seq) + + \brief converts a seq to a list. + + seq = seq to be converted. + + If the seq is an empty seq it is converted to an empty list (BOOST_PP_NIL). + Otherwise the seq is converted to a list with the same number of elements as the seq. +*/ + +#if BOOST_VMD_MSVC +#define BOOST_VMD_SEQ_TO_LIST(seq) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(seq), \ + BOOST_VMD_SEQ_TO_LIST_PE, \ + BOOST_VMD_SEQ_TO_LIST_NPE \ + ) \ + (seq) \ +/**/ +#define BOOST_VMD_SEQ_TO_LIST_PE(seq) BOOST_PP_NIL +/**/ +#define BOOST_VMD_SEQ_TO_LIST_NPE(seq) BOOST_PP_SEQ_TO_LIST(seq) +/**/ +#else +#define BOOST_VMD_SEQ_TO_LIST(seq) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(seq), \ + BOOST_VMD_IDENTITY(BOOST_PP_NIL), \ + BOOST_PP_SEQ_TO_LIST \ + ) \ + (seq) \ +/**/ +#endif + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_SEQ_TO_LIST_HPP */ diff --git a/boost/vmd/seq/to_tuple.hpp b/boost/vmd/seq/to_tuple.hpp new file mode 100644 index 0000000000..b41c5aca50 --- /dev/null +++ b/boost/vmd/seq/to_tuple.hpp @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_SEQ_TO_TUPLE_HPP) +#define BOOST_VMD_SEQ_TO_TUPLE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/seq/to_tuple.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_SEQ_TO_TUPLE(seq) + + \brief converts a seq to a tuple. + + seq = seq to be converted. + + If the seq is an empty seq it is converted to an empty tuple. + Otherwise the seq is converted to a tuple with the same number of elements as the seq. +*/ + +#define BOOST_VMD_SEQ_TO_TUPLE(seq) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(seq), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_SEQ_TO_TUPLE \ + ) \ + (seq) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_SEQ_TO_TUPLE_HPP */ diff --git a/boost/vmd/size.hpp b/boost/vmd/size.hpp new file mode 100644 index 0000000000..d2ff4d4b83 --- /dev/null +++ b/boost/vmd/size.hpp @@ -0,0 +1,57 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_SIZE_HPP) +#define BOOST_VMD_SIZE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/sequence_size.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_SIZE(sequence) + + \brief Returns the size of a sequence. + + sequence = A sequence to test. + + returns = If the sequence is empty returns 0, else returns the number of elements + in the sequence. + +*/ + +#define BOOST_VMD_SIZE(sequence) \ + BOOST_VMD_DETAIL_SEQUENCE_SIZE(sequence) \ +/**/ + +/** \def BOOST_VMD_SIZE_D(d,sequence) + + \brief Returns the size of a sequence. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + sequence = A sequence to test. + + returns = If the sequence is empty returns 0, else returns the number of elements + in the sequence. + +*/ + +#define BOOST_VMD_SIZE_D(d,sequence) \ + BOOST_VMD_DETAIL_SEQUENCE_SIZE_D(d,sequence) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_SIZE_HPP */ diff --git a/boost/vmd/to_array.hpp b/boost/vmd/to_array.hpp new file mode 100644 index 0000000000..afecf9cb88 --- /dev/null +++ b/boost/vmd/to_array.hpp @@ -0,0 +1,101 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TO_ARRAY_HPP) +#define BOOST_VMD_TO_ARRAY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/sequence_to_array.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TO_ARRAY(...) + + \brief Converts a sequence to a Boost PP array whose elements are the elements of the sequence. + + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to convert. + + Further optional variadic parameters can be return type parameters. Return type + parameters allow each element in the sequence to be converted to a two-element + tuple where the first tuple element is the type and the second tuple element + is the element data. + + The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each + converted element but just the data. All of the rest return the type and data as the + two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is + returned if the element is an array, else a tuple type is returned if the element is a tuple, + else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple type is returned if the element + is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE + is specified a tuple type is returned for all tuple-like data, else the actual type is returned + for non-tuple data. If more than one return type optional parameter is specified the last one + specified determines the return type. + + returns = A Boost PP array. The sequence is empty the Boost PP array is an empty array. + If an optional return type other than BOOST_VMD_RETURN_NO_TYPE + is specified the type and the data of each element is + returned as the array element. Otherwise just the data + is returned as the array element, which is the default. + +*/ + +#define BOOST_VMD_TO_ARRAY(...) \ + BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY(__VA_ARGS__) \ +/**/ + +/** \def BOOST_VMD_TO_ARRAY_D(d,...) + + \brief Converts a sequence to a Boost PP array whose elements are the elements of the sequence. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to convert. + + Further optional variadic parameters can be return type parameters. Return type + parameters allow each element in the sequence to be converted to a two-element + tuple where the first tuple element is the type and the second tuple element + is the element data. + + The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each + converted element but just the data. All of the rest return the type and data as the + two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is + returned if the element is an array, else a tuple type is returned if the element is a tuple, + else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple type is returned if the element + is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE + is specified a tuple type is returned for all tuple-like data, else the actual type is returned + for non-tuple data. If more than one return type optional parameter is specified the last one + specified determines the return type. + + returns = A Boost PP array. The sequence is empty the Boost PP array is empty. + If an optional return type other than BOOST_VMD_RETURN_NO_TYPE + is specified the type and the data of each element is + returned as the array element. Otherwise just the data + is returned as the array element, which is the default. + +*/ + +#define BOOST_VMD_TO_ARRAY_D(d,...) \ + BOOST_VMD_DETAIL_SEQUENCE_TO_ARRAY_D(d,__VA_ARGS__) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TO_ARRAY_HPP */ diff --git a/boost/vmd/to_list.hpp b/boost/vmd/to_list.hpp new file mode 100644 index 0000000000..eeae19235b --- /dev/null +++ b/boost/vmd/to_list.hpp @@ -0,0 +1,101 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TO_LIST_HPP) +#define BOOST_VMD_TO_LIST_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/sequence_to_list.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TO_LIST(...) + + \brief Converts a sequence to a Boost PP list whose elements are the elements of the sequence. + + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to convert. + + Further optional variadic parameters can be return type parameters. Return type + parameters allow each element in the sequence to be converted to a two-element + tuple where the first tuple element is the type and the second tuple element + is the element data. + + The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each + converted element but just the data. All of the rest return the type and data as the + two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is + returned if the element is an array, else a tuple type is returned if the element is a tuple, + else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple type is returned if the element + is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE + is specified a tuple type is returned for all tuple-like data, else the actual type is returned + for non-tuple data. If more than one return type optional parameter is specified the last one + specified determines the return type. + + returns = A Boost PP list. The sequence is empty the Boost PP list is an empty list. + If an optional return type other than BOOST_VMD_RETURN_NO_TYPE + is specified the type and the data of each element is + returned as the list element. Otherwise just the data + is returned as the list element, which is the default. + +*/ + +#define BOOST_VMD_TO_LIST(...) \ + BOOST_VMD_DETAIL_SEQUENCE_TO_LIST(__VA_ARGS__) \ +/**/ + +/** \def BOOST_VMD_TO_LIST_D(d,...) + + \brief Converts a sequence to a Boost PP list whose elements are the elements of the sequence. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to convert. + + Further optional variadic parameters can be return type parameters. Return type + parameters allow each element in the sequence to be converted to a two-element + tuple where the first tuple element is the type and the second tuple element + is the element data. + + The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each + converted element but just the data. All of the rest return the type and data as the + two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is + returned if the element is an array, else a tuple type is returned if the element is a tuple, + else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple type is returned if the element + is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE + is specified a tuple type is returned for all tuple-like data, else the actual type is returned + for non-tuple data. If more than one return type optional parameter is specified the last one + specified determines the return type. + + returns = A Boost PP list. The sequence is empty the Boost PP list is an empty list. + If an optional return type other than BOOST_VMD_RETURN_NO_TYPE + is specified the type and the data of each element is + returned as the list element. Otherwise just the data + is returned as the list element, which is the default. + +*/ + +#define BOOST_VMD_TO_LIST_D(d,...) \ + BOOST_VMD_DETAIL_SEQUENCE_TO_LIST_D(d,__VA_ARGS__) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TO_LIST_HPP */ diff --git a/boost/vmd/to_seq.hpp b/boost/vmd/to_seq.hpp new file mode 100644 index 0000000000..ca11fee195 --- /dev/null +++ b/boost/vmd/to_seq.hpp @@ -0,0 +1,101 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TO_SEQ_HPP) +#define BOOST_VMD_TO_SEQ_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/sequence_to_seq.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TO_SEQ(...) + + \brief Converts a sequence to a Boost PP seq whose elements are the elements of the sequence. + + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to convert. + + Further optional variadic parameters can be return type parameters. Return type + parameters allow each element in the sequence to be converted to a two-element + tuple where the first tuple element is the type and the second tuple element + is the element data. + + The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each + converted element but just the data. All of the rest return the type and data as the + two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is + returned if the element is an array, else a tuple type is returned if the element is a tuple, + else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple type is returned if the element + is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE + is specified a tuple type is returned for all tuple-like data, else the actual type is returned + for non-tuple data. If more than one return type optional parameter is specified the last one + specified determines the return type. + + returns = A Boost PP seq. If the sequence is empty the return is emptiness + since an empty seq does not exist. If an optional return type other + than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of + each element is returned as the seq element. Otherwise just the data + is returned as the seq element, which is the default. + +*/ + +#define BOOST_VMD_TO_SEQ(...) \ + BOOST_VMD_DETAIL_SEQUENCE_TO_SEQ(__VA_ARGS__) \ +/**/ + +/** \def BOOST_VMD_TO_SEQ_D(d,...) + + \brief Converts a sequence to a Boost PP seq whose elements are the elements of the sequence. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to convert. + + Further optional variadic parameters can be return type parameters. Return type + parameters allow each element in the sequence to be converted to a two-element + tuple where the first tuple element is the type and the second tuple element + is the element data. + + The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each + converted element but just the data. All of the rest return the type and data as the + two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is + returned if the element is an array, else a tuple type is returned if the element is a tuple, + else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple type is returned if the element + is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE + is specified a tuple type is returned for all tuple-like data, else the actual type is returned + for non-tuple data. If more than one return type optional parameter is specified the last one + specified determines the return type. + + returns = A Boost PP seq. If the sequence is empty the return is emptiness + since an empty seq does not exist. If an optional return type other + than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of + each element is returned as the seq element. Otherwise just the data + is returned as the seq element, which is the default. + +*/ + +#define BOOST_VMD_TO_SEQ_D(d,...) \ + BOOST_VMD_DETAIL_SEQUENCE_TO_SEQ_D(d,__VA_ARGS__) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TO_SEQ_HPP */ diff --git a/boost/vmd/to_tuple.hpp b/boost/vmd/to_tuple.hpp new file mode 100644 index 0000000000..a15858988c --- /dev/null +++ b/boost/vmd/to_tuple.hpp @@ -0,0 +1,101 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TO_TUPLE_HPP) +#define BOOST_VMD_TO_TUPLE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/detail/sequence_to_tuple.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TO_TUPLE(...) + + \brief Converts a sequence to a Boost PP tuple whose elements are the elements of the sequence. + + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to convert. + + Further optional variadic parameters can be return type parameters. Return type + parameters allow each element in the sequence to be converted to a two-element + tuple where the first tuple element is the type and the second tuple element + is the element data. + + The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each + converted element but just the data. All of the rest return the type and data as the + two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is + returned if the element is an array, else a tuple type is returned if the element is a tuple, + else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple type is returned if the element + is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE + is specified a tuple type is returned for all tuple-like data, else the actual type is returned + for non-tuple data. If more than one return type optional parameter is specified the last one + specified determines the return type. + + returns = A Boost PP tuple. If the sequence is empty the return is emptiness + since an empty tuple does not exist. If an optional return type other + than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of + each element is returned as the tuple element. Otherwise just the data + is returned as the tuple element, which is the default. + +*/ + +#define BOOST_VMD_TO_TUPLE(...) \ + BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE(__VA_ARGS__) \ +/**/ + +/** \def BOOST_VMD_TO_TUPLE_D(d,...) + + \brief Converts a sequence to a Boost PP tuple whose elements are the elements of the sequence. Re-entrant version. + + d = The next available BOOST_PP_WHILE iteration. + ... = Variadic parameters. + + The first variadic parameter is required and is the sequence to convert. + + Further optional variadic parameters can be return type parameters. Return type + parameters allow each element in the sequence to be converted to a two-element + tuple where the first tuple element is the type and the second tuple element + is the element data. + + The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each + converted element but just the data. All of the rest return the type and data as the + two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element + is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is + returned if the element is an array, else a tuple type is returned if the element is a tuple, + else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified + a list type is returned if the element is a list, else a tuple type is returned if the element + is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE + is specified a tuple type is returned for all tuple-like data, else the actual type is returned + for non-tuple data. If more than one return type optional parameter is specified the last one + specified determines the return type. + + returns = A Boost PP tuple. If the sequence is empty the return is emptiness + since an empty tuple does not exist. If an optional return type other + than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of + each element is returned as the tuple element. Otherwise just the data + is returned as the tuple element, which is the default. + +*/ + +#define BOOST_VMD_TO_TUPLE_D(d,...) \ + BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE_D(d,__VA_ARGS__) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TO_TUPLE_HPP */ diff --git a/boost/vmd/tuple.hpp b/boost/vmd/tuple.hpp new file mode 100644 index 0000000000..0752ba7169 --- /dev/null +++ b/boost/vmd/tuple.hpp @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TUPLE_HPP) +#define BOOST_VMD_TUPLE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/tuple/is_vmd_tuple.hpp> +#include <boost/vmd/tuple/pop_back.hpp> +#include <boost/vmd/tuple/pop_front.hpp> +#include <boost/vmd/tuple/push_back.hpp> +#include <boost/vmd/tuple/push_front.hpp> +#include <boost/vmd/tuple/remove.hpp> +#include <boost/vmd/tuple/size.hpp> +#include <boost/vmd/tuple/to_array.hpp> +#include <boost/vmd/tuple/to_list.hpp> +#include <boost/vmd/tuple/to_seq.hpp> + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TUPLE_HPP */ diff --git a/boost/vmd/tuple/is_vmd_tuple.hpp b/boost/vmd/tuple/is_vmd_tuple.hpp new file mode 100644 index 0000000000..58595b601a --- /dev/null +++ b/boost/vmd/tuple/is_vmd_tuple.hpp @@ -0,0 +1,56 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_IS_VMD_TUPLE_HPP) +#define BOOST_VMD_IS_VMD_TUPLE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_tuple.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_IS_VMD_TUPLE(sequence) + + \brief Determines if a sequence is a VMD tuple. + + The macro checks that the sequence is a VMD tuple. + A VMD tuple, which may be a Boost PP tuple or emptiness, is a superset of a Boost PP tuple. + It returns 1 if it is a VMD tuple, else if returns 0. + + sequence = a possible Boost PP tuple + + returns = 1 if it a VMD tuple, else returns 0. + +*/ + +#define BOOST_VMD_IS_VMD_TUPLE(sequence) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(sequence), \ + BOOST_VMD_IDENTITY(1), \ + BOOST_VMD_IS_TUPLE \ + ) \ + (sequence) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_IS_VMD_TUPLE_HPP */ diff --git a/boost/vmd/tuple/pop_back.hpp b/boost/vmd/tuple/pop_back.hpp new file mode 100644 index 0000000000..e9a7558969 --- /dev/null +++ b/boost/vmd/tuple/pop_back.hpp @@ -0,0 +1,73 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TUPLE_POP_BACK_HPP) +#define BOOST_VMD_TUPLE_POP_BACK_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/pop_back.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TUPLE_POP_BACK(tuple) + + \brief pops an element from the end of a tuple. + + tuple = tuple to pop an element from. + + If the tuple is an empty tuple the result is undefined. + If the tuple is a single element the result is an empty tuple. + Otherwise the result is a tuple after removing the last element. +*/ + +#define BOOST_VMD_TUPLE_POP_BACK(tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(tuple),1), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_TUPLE_POP_BACK \ + ) \ + (tuple) \ +/**/ + +/** \def BOOST_VMD_TUPLE_POP_BACK_Z(z,tuple) + + \brief pops an element from the end of a tuple. It reenters BOOST_PP_REPEAT with maximum efficiency. + + z = the next available BOOST_PP_REPEAT dimension. + tuple = tuple to pop an element from. + + If the tuple is an empty tuple the result is undefined. + If the tuple is a single element the result is an empty tuple. + Otherwise the result is a tuple after removing the last element. +*/ + +#define BOOST_VMD_TUPLE_POP_BACK_Z(z,tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(tuple),1), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_TUPLE_POP_BACK_Z \ + ) \ + (z,tuple) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TUPLE_POP_BACK_HPP */ diff --git a/boost/vmd/tuple/pop_front.hpp b/boost/vmd/tuple/pop_front.hpp new file mode 100644 index 0000000000..fc84492184 --- /dev/null +++ b/boost/vmd/tuple/pop_front.hpp @@ -0,0 +1,73 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TUPLE_POP_FRONT_HPP) +#define BOOST_VMD_TUPLE_POP_FRONT_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/pop_front.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TUPLE_POP_FRONT(tuple) + + \brief pops an element from the front of a tuple. + + tuple = tuple to pop an element from. + + If the tuple is an empty tuple the result is undefined. + If the tuple is a single element the result is an empty tuple. + Otherwise the result is a tuple after removing the first element. +*/ + +#define BOOST_VMD_TUPLE_POP_FRONT(tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(tuple),1), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_TUPLE_POP_FRONT \ + ) \ + (tuple) \ +/**/ + +/** \def BOOST_VMD_TUPLE_POP_FRONT_Z(z,tuple) + + \brief pops an element from the front of a tuple. It reenters BOOST_PP_REPEAT with maximum efficiency. + + z = the next available BOOST_PP_REPEAT dimension. + tuple = tuple to pop an element from. + + If the tuple is an empty tuple the result is undefined. + If the tuple is a single element the result is an empty tuple. + Otherwise the result is a tuple after removing the first element. +*/ + +#define BOOST_VMD_TUPLE_POP_FRONT_Z(z,tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(tuple),1), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_TUPLE_POP_FRONT_Z \ + ) \ + (z,tuple) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TUPLE_POP_FRONT_HPP */ diff --git a/boost/vmd/tuple/push_back.hpp b/boost/vmd/tuple/push_back.hpp new file mode 100644 index 0000000000..778e257c88 --- /dev/null +++ b/boost/vmd/tuple/push_back.hpp @@ -0,0 +1,53 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TUPLE_PUSH_BACK_HPP) +#define BOOST_VMD_TUPLE_PUSH_BACK_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/push_back.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TUPLE_PUSH_BACK(tuple,elem) + + \brief appends an element to the end of a tuple. + + tuple = tuple to to append an element to. + elem = element to append. + + If the tuple is an empty tuple the result is a tuple with the single element. + Otherwise the result is a tuple after adding the element to the end. +*/ + +#define BOOST_VMD_TUPLE_PUSH_BACK(tuple,elem) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(tuple), \ + BOOST_VMD_IDENTITY((elem)), \ + BOOST_PP_TUPLE_PUSH_BACK \ + ) \ + (tuple,elem) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TUPLE_PUSH_BACK_HPP */ diff --git a/boost/vmd/tuple/push_front.hpp b/boost/vmd/tuple/push_front.hpp new file mode 100644 index 0000000000..4ec57ad698 --- /dev/null +++ b/boost/vmd/tuple/push_front.hpp @@ -0,0 +1,53 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TUPLE_PUSH_FRONT_HPP) +#define BOOST_VMD_TUPLE_PUSH_FRONT_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/push_front.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TUPLE_PUSH_FRONT(tuple,elem) + + \brief inserts an element at the beginning of a tuple. + + tuple = tuple to insert an element at. + elem = element to insert. + + If the tuple is an empty tuple the result is a tuple with the single element. + Otherwise the result is a tuple after inserting the element at the beginning. +*/ + +#define BOOST_VMD_TUPLE_PUSH_FRONT(tuple,elem) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(tuple), \ + BOOST_VMD_IDENTITY((elem)), \ + BOOST_PP_TUPLE_PUSH_FRONT \ + ) \ + (tuple,elem) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TUPLE_PUSH_FRONT_HPP */ diff --git a/boost/vmd/tuple/remove.hpp b/boost/vmd/tuple/remove.hpp new file mode 100644 index 0000000000..7f1324798d --- /dev/null +++ b/boost/vmd/tuple/remove.hpp @@ -0,0 +1,84 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TUPLE_REMOVE_HPP) +#define BOOST_VMD_TUPLE_REMOVE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/logical/bitand.hpp> +#include <boost/preprocessor/tuple/remove.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TUPLE_REMOVE(tuple,index) + + \brief removes an element from a tuple. + + tuple = tuple from which an element is to be removed. + index = The zero-based position in tuple of the element to be removed. + + If index is greater or equal to the tuple size the result is undefined. + If the tuple is a single element and the index is 0 the result is an empty tuple. + Otherwise the result is a tuple after removing the index element. +*/ + +#define BOOST_VMD_TUPLE_REMOVE(tuple,index) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_PP_EQUAL(index,0), \ + BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(tuple),1) \ + ), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_TUPLE_REMOVE \ + ) \ + (tuple,index) \ +/**/ + +/** \def BOOST_VMD_TUPLE_REMOVE_D(d,tuple,index) + + \brief removes an element from a tuple. It reenters BOOST_PP_WHILE with maximum efficiency. + + d = The next available BOOST_PP_WHILE iteration. + tuple = tuple from which an element is to be removed. + index = The zero-based position in tuple of the element to be removed. + + If index is greater or equal to the tuple size the result is undefined. + If the tuple is a single element and the index is 0 the result is an empty tuple. + Otherwise the result is a tuple after removing the index element. +*/ + +#define BOOST_VMD_TUPLE_REMOVE_D(d,tuple,index) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_BITAND \ + ( \ + BOOST_PP_EQUAL_D(d,index,0), \ + BOOST_PP_EQUAL_D(d,BOOST_PP_TUPLE_SIZE(tuple),1) \ + ), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_TUPLE_REMOVE_D \ + ) \ + (d,tuple,index) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TUPLE_REMOVE_HPP */ diff --git a/boost/vmd/tuple/size.hpp b/boost/vmd/tuple/size.hpp new file mode 100644 index 0000000000..1e8d27169f --- /dev/null +++ b/boost/vmd/tuple/size.hpp @@ -0,0 +1,52 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TUPLE_SIZE_HPP) +#define BOOST_VMD_TUPLE_SIZE_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TUPLE_SIZE(tuple) + + \brief expands to the size of the tuple passed to it. + + tuple = tuple whose size is to be extracted. + + If the tuple is an empty tuple its size is 0. + Otherwise the result is the number of elements in the tuple. +*/ + +#define BOOST_VMD_TUPLE_SIZE(tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(tuple), \ + BOOST_VMD_IDENTITY(0), \ + BOOST_PP_TUPLE_SIZE \ + ) \ + (tuple) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TUPLE_SIZE_HPP */ diff --git a/boost/vmd/tuple/to_array.hpp b/boost/vmd/tuple/to_array.hpp new file mode 100644 index 0000000000..4e9c8a2945 --- /dev/null +++ b/boost/vmd/tuple/to_array.hpp @@ -0,0 +1,52 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TUPLE_TO_ARRAY_HPP) +#define BOOST_VMD_TUPLE_TO_ARRAY_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/to_array.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TUPLE_TO_ARRAY(tuple) + + \brief converts a tuple to an array. + + tuple = tuple to be converted. + + If the tuple is an empty tuple it is converted to an array with 0 elements. + Otherwise the tuple is converted to an array with the same number of elements as the tuple. +*/ + +#define BOOST_VMD_TUPLE_TO_ARRAY(tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(tuple), \ + BOOST_VMD_IDENTITY((0,())), \ + BOOST_PP_TUPLE_TO_ARRAY \ + ) \ + (tuple) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TUPLE_TO_ARRAY_HPP */ diff --git a/boost/vmd/tuple/to_list.hpp b/boost/vmd/tuple/to_list.hpp new file mode 100644 index 0000000000..a66f26055b --- /dev/null +++ b/boost/vmd/tuple/to_list.hpp @@ -0,0 +1,52 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TUPLE_TO_LIST_HPP) +#define BOOST_VMD_TUPLE_TO_LIST_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/to_list.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TUPLE_TO_LIST(tuple) + + \brief converts a tuple to a list. + + tuple = tuple to be converted. + + If the tuple is an empty tuple it is converted to an empty list (BOOST_PP_NIL). + Otherwise the tuple is converted to a list with the same number of elements as the tuple. +*/ + +#define BOOST_VMD_TUPLE_TO_LIST(tuple) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(tuple), \ + BOOST_VMD_IDENTITY(BOOST_PP_NIL), \ + BOOST_PP_TUPLE_TO_LIST \ + ) \ + (tuple) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TUPLE_TO_LIST_HPP */ diff --git a/boost/vmd/tuple/to_seq.hpp b/boost/vmd/tuple/to_seq.hpp new file mode 100644 index 0000000000..de4a3d42e4 --- /dev/null +++ b/boost/vmd/tuple/to_seq.hpp @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VMD_TUPLE_TO_SEQ_HPP) +#define BOOST_VMD_TUPLE_TO_SEQ_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/to_seq.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + The succeeding comments in this file are in doxygen format. + +*/ + +/** \file +*/ + +/** \def BOOST_VMD_TUPLE_TO_SEQ(tuple) + + \brief converts a tuple to a seq. + + tuple = tuple to be converted. + + If the tuple is an empty tuple it is converted to an empty seq. + Otherwise the tuple is converted to a seq with the same number of elements as the tuple. +*/ + +#define BOOST_VMD_TUPLE_TO_SEQ(tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_EMPTY(tuple), \ + BOOST_VMD_EMPTY, \ + BOOST_PP_TUPLE_TO_SEQ \ + ) \ + (tuple) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VMD_TUPLE_TO_SEQ_HPP */ diff --git a/boost/vmd/vmd.hpp b/boost/vmd/vmd.hpp new file mode 100644 index 0000000000..1ef18c6df0 --- /dev/null +++ b/boost/vmd/vmd.hpp @@ -0,0 +1,54 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to 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). + +#if !defined(BOOST_VARIADIC_MACRO_DATA_HPP) +#define BOOST_VARIADIC_MACRO_DATA_HPP + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/vmd/array.hpp> +#include <boost/vmd/assert.hpp> +#include <boost/vmd/assert_is_array.hpp> +#include <boost/vmd/assert_is_empty.hpp> +#include <boost/vmd/assert_is_identifier.hpp> +#include <boost/vmd/assert_is_list.hpp> +#include <boost/vmd/assert_is_number.hpp> +#include <boost/vmd/assert_is_seq.hpp> +#include <boost/vmd/assert_is_tuple.hpp> +#include <boost/vmd/assert_is_type.hpp> +#include <boost/vmd/elem.hpp> +#include <boost/vmd/empty.hpp> +#include <boost/vmd/enum.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/vmd/get_type.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_array.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_empty_array.hpp> +#include <boost/vmd/is_empty_list.hpp> +#include <boost/vmd/is_identifier.hpp> +#include <boost/vmd/is_list.hpp> +#include <boost/vmd/is_multi.hpp> +#include <boost/vmd/is_number.hpp> +#include <boost/vmd/is_parens_empty.hpp> +#include <boost/vmd/is_seq.hpp> +#include <boost/vmd/is_tuple.hpp> +#include <boost/vmd/is_type.hpp> +#include <boost/vmd/is_unary.hpp> +#include <boost/vmd/list.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/vmd/seq.hpp> +#include <boost/vmd/size.hpp> +#include <boost/vmd/to_array.hpp> +#include <boost/vmd/to_list.hpp> +#include <boost/vmd/to_seq.hpp> +#include <boost/vmd/to_tuple.hpp> +#include <boost/vmd/tuple.hpp> + +#endif /* BOOST_PP_VARIADICS */ +#endif /* BOOST_VARIADIC_MACRO_DATA_HPP */ |