diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:33:54 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:36:09 +0900 |
commit | d9ec475d945d3035377a0d89ed42e382d8988891 (patch) | |
tree | 34aff2cee4b209906243ab5499d61f3edee2982f /boost/vmd/to_array.hpp | |
parent | 71d216b90256936a9638f325af9bc69d720e75de (diff) | |
download | boost-d9ec475d945d3035377a0d89ed42e382d8988891.tar.gz boost-d9ec475d945d3035377a0d89ed42e382d8988891.tar.bz2 boost-d9ec475d945d3035377a0d89ed42e382d8988891.zip |
Imported Upstream version 1.60.0
Change-Id: Ie709530d6d5841088ceaba025cbe175a4ef43050
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/vmd/to_array.hpp')
-rw-r--r-- | boost/vmd/to_array.hpp | 101 |
1 files changed, 101 insertions, 0 deletions
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 */ |