Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:38

0001 
0002 //  (C) Copyright Edward Diener 2011-2015
0003 //  Use, modification and distribution are subject to the Boost Software License,
0004 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 //  http://www.boost.org/LICENSE_1_0.txt).
0006 
0007 #if !defined(BOOST_VMD_TO_TUPLE_HPP)
0008 #define BOOST_VMD_TO_TUPLE_HPP
0009 
0010 #include <boost/vmd/detail/setup.hpp>
0011 
0012 #if BOOST_PP_VARIADICS
0013 
0014 #include <boost/vmd/detail/sequence_to_tuple.hpp>
0015 
0016 /*
0017 
0018   The succeeding comments in this file are in doxygen format.
0019 
0020 */
0021 
0022 /** \file
0023 */
0024 
0025 /** \def BOOST_VMD_TO_TUPLE(...)
0026 
0027     \brief Converts a sequence to a Boost PP tuple whose elements are the elements of the sequence.
0028 
0029     ...       = Variadic parameters.
0030     
0031     The first variadic parameter is required and is the sequence to convert.
0032     
0033     Further optional variadic parameters can be return type parameters. Return type
0034     parameters allow each element in the sequence to be converted to a two-element
0035     tuple where the first tuple element is the type and the second tuple element
0036     is the element data.
0037     
0038     The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each
0039     converted element but just the data. All of the rest return the type and data as the
0040     two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element
0041     is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is 
0042     returned if the element is an array, else a tuple type is returned if the element is a tuple, 
0043     else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified
0044     a list type is returned if the element is a list, else a tuple type is returned if the element 
0045     is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE 
0046     is specified a tuple type is returned for all tuple-like data, else the actual type is returned 
0047     for non-tuple data. If more than one return type optional parameter is specified the last one 
0048     specified determines the return type.
0049     
0050     returns   = A Boost PP tuple. If the sequence is empty the return is emptiness
0051                 since an empty tuple does not exist. If an optional return type other 
0052                 than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of 
0053                 each element is returned as the tuple element. Otherwise just the data
0054                 is returned as the tuple element, which is the default.
0055     
0056 */
0057 
0058 #define BOOST_VMD_TO_TUPLE(...) \
0059     BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE(__VA_ARGS__) \
0060 /**/
0061 
0062 /** \def BOOST_VMD_TO_TUPLE_D(d,...)
0063 
0064     \brief Converts a sequence to a Boost PP tuple whose elements are the elements of the sequence. Re-entrant version.
0065 
0066     d         = The next available BOOST_PP_WHILE iteration. <br/>
0067     ...       = Variadic parameters.
0068     
0069     The first variadic parameter is required and is the sequence to convert.
0070     
0071     Further optional variadic parameters can be return type parameters. Return type
0072     parameters allow each element in the sequence to be converted to a two-element
0073     tuple where the first tuple element is the type and the second tuple element
0074     is the element data.
0075     
0076     The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each
0077     converted element but just the data. All of the rest return the type and data as the
0078     two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element
0079     is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is 
0080     returned if the element is an array, else a tuple type is returned if the element is a tuple, 
0081     else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified
0082     a list type is returned if the element is a list, else a tuple type is returned if the element 
0083     is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE 
0084     is specified a tuple type is returned for all tuple-like data, else the actual type is returned 
0085     for non-tuple data. If more than one return type optional parameter is specified the last one 
0086     specified determines the return type.
0087     
0088     returns   = A Boost PP tuple. If the sequence is empty the return is emptiness
0089                 since an empty tuple does not exist. If an optional return type other 
0090                 than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of 
0091                 each element is    returned as the tuple element. Otherwise just the data
0092                 is returned as the tuple element, which is the default.
0093     
0094 */
0095 
0096 #define BOOST_VMD_TO_TUPLE_D(d,...) \
0097     BOOST_VMD_DETAIL_SEQUENCE_TO_TUPLE_D(d,__VA_ARGS__) \
0098 /**/
0099 
0100 #endif /* BOOST_PP_VARIADICS */
0101 #endif /* BOOST_VMD_TO_TUPLE_HPP */