1 2 // (C) Copyright Edward Diener 2011-2015 3 // Use, modification and distribution are subject to the Boost Software License, 4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt). 6 7 #if !defined(BOOST_VMD_GET_TYPE_HPP) 8 #define BOOST_VMD_GET_TYPE_HPP 9 10 #include <boost/vmd/detail/setup.hpp> 11 12 #if BOOST_PP_VARIADICS 13 14 #include <boost/vmd/detail/sequence_type.hpp> 15 16 /* 17 18 The succeeding comments in this file are in doxygen format. 19 20 */ 21 22 /** \file 23 */ 24 25 /** \def BOOST_VMD_GET_TYPE(...) 26 27 \brief Returns the type of a sequence as a VMD type. 28 29 ... = variadic parameters. 30 31 The first variadic parameter is required and is the sequence whose type we are getting. 32 33 The optional variadic parameters are return type parameters. 34 35 The macro returns the type of a sequence as a VMD type. The type of an empty sequence 36 is always BOOST_VMD_TYPE_EMPTY and the type of a multi-element is always 37 BOOST_VMD_TYPE_SEQUENCE. The type of a single-element sequence is the 38 type of that single element. 39 40 The type returned can be modified by specifying an optional return type parameter. 41 42 If BOOST_VMD_RETURN_TYPE, the default, is specified the specific type of the element 43 is returned. 44 45 If BOOST_VMD_RETURN_TYPE_ARRAY is specified 46 an array type is returned if the element is an array, else a tuple 47 type is returned if the element is a tuple, else the actual type 48 is returned for non-tuple data. 49 50 If BOOST_VMD_RETURN_TYPE_LIST is specified 51 a list type is returned if the element is a list, else a tuple 52 type is returned if the element is a tuple, else the actual type 53 is returned for non-tuple data. 54 55 If BOOST_VMD_RETURN_TYPE_TUPLE is specified 56 a tuple type is returned for all tuple-like data, else the actual type 57 is returned for non-tuple data. 58 59 If BOOST_VMD_RETURN_NO_TYPE is specified it is ignored since the macro 60 always returns the type of the sequence. 61 62 If more than one return type optional parameter is specified the last 63 one specified determines the return type. 64 65 returns = the type of the sequence as a VMD type. 66 67 */ 68 69 #define BOOST_VMD_GET_TYPE(...) \ 70 BOOST_VMD_DETAIL_SEQUENCE_TYPE(__VA_ARGS__) \ 71 /**/ 72 73 /** \def BOOST_VMD_GET_TYPE_D(d,...) 74 75 \brief Returns the type of a sequence as a VMD type. Re-entrant version. 76 77 d = The next available BOOST_PP_WHILE iteration. <br/> 78 ... = variadic parameters. 79 80 The first variadic parameter is required and is the sequence whose type we are getting. 81 82 The optional variadic parameters are return type parameters. 83 84 The macro returns the type of a sequence as a VMD type. The type of an empty sequence 85 is always BOOST_VMD_TYPE_EMPTY and the type of a multi-element is always 86 BOOST_VMD_TYPE_SEQUENCE. The type of a single-element sequence is the 87 type of that single element. 88 89 The type returned can be modified by specifying an optional return type parameter. 90 91 If BOOST_VMD_RETURN_TYPE, the default, is specified the specific type of the element 92 is returned. 93 94 If BOOST_VMD_RETURN_TYPE_ARRAY is specified 95 an array type is returned if the element is an array, else a tuple 96 type is returned if the element is a tuple, else the actual type 97 is returned for non-tuple data. 98 99 If BOOST_VMD_RETURN_TYPE_LIST is specified 100 a list type is returned if the element is a list, else a tuple 101 type is returned if the element is a tuple, else the actual type 102 is returned for non-tuple data. 103 104 If BOOST_VMD_RETURN_TYPE_TUPLE is specified 105 a tuple type is returned for all tuple-like data, else the actual type 106 is returned for non-tuple data. 107 108 If BOOST_VMD_RETURN_NO_TYPE is specified it is ignored since the macro 109 always returns the type of the sequence. 110 111 If more than one return type optional parameter is specified the last 112 one specified determines the return type. 113 114 returns = the type of the sequence as a VMD type. 115 116 */ 117 118 #define BOOST_VMD_GET_TYPE_D(d,...) \ 119 BOOST_VMD_DETAIL_SEQUENCE_TYPE_D(d,__VA_ARGS__) \ 120 /**/ 121 122 #endif /* BOOST_PP_VARIADICS */ 123 #endif /* BOOST_VMD_GET_TYPE_HPP */ 124