1 /****************************************************************************
3 ** Copyright (C) Qxt Foundation. Some rights reserved.
5 ** This file is part of the QxtCore module of the Qt eXTension library
7 ** This library is free software; you can redistribute it and/or modify it
8 ** under the terms of th Common Public License, version 1.0, as published by
11 ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
12 ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
13 ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
14 ** FITNESS FOR A PARTICULAR PURPOSE.
16 ** You should have received a copy of the CPL along with this file.
17 ** See the LICENSE file and the cpl1.0.txt file included with the source
18 ** distribution for more information. If you did not receive a copy of the
19 ** license, contact the Qxt Foundation.
21 ** <http://libqxt.sourceforge.net> <foundation@libqxt.org>
23 ****************************************************************************/
33 enum { length = 0, extends = false };
36 template <typename T1 = QxtNull, typename T2 = QxtNull, typename T3 = QxtNull, typename T4 = QxtNull, typename T5 = QxtNull,
37 typename T6 = QxtNull, typename T7 = QxtNull, typename T8 = QxtNull, typename T9 = QxtNull, typename EXTEND = QxtType::NoExtend>
40 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename EXTEND>
44 typedef QxtTypeList<T2, T3, T4, T5, T6, T7, T8, T9, NoExtend, EXTEND> tail;
45 typedef EXTEND extend;
46 enum { length = tail::length + 1, extends = EXTEND::extends };
49 template<typename EXTEND>
50 struct QxtTypeList<NoExtend, NoExtend, NoExtend, NoExtend, NoExtend, NoExtend, NoExtend, NoExtend, NoExtend, EXTEND>
52 typedef typename EXTEND::head head;
53 typedef typename EXTEND::tail tail;
54 typedef EXTEND extend;
55 enum { length = EXTEND::length, extends = EXTEND::extends };
59 struct QxtTypeList<NoExtend, NoExtend, NoExtend, NoExtend, NoExtend, NoExtend, NoExtend, NoExtend, NoExtend, QxtType::NoExtend>
61 typedef QxtNull extend;
62 enum { length = 0, extends = false };
67 using QxtType::QxtTypeList;
71 /*! \relates QxtTypeList
72 * Declares a one-column tuple.
74 #define Qxt1TypeList(a) QxtTypeList<a >
76 /*! \relates QxtTypeList
77 * Declares a two-column tuple, similar to QPair.
79 #define Qxt2TypeList(a, b) QxtTypeList<a, b >
81 /*! \relates QxtTypeList
82 * Declares a three-column tuple, similar to QxtTriple.
84 #define Qxt3TypeList(a, b, c) QxtTypeList<a, b, c >
86 /*! \relates QxtTypeList
87 * Declares a four-column tuple.
89 #define Qxt4TypeList(a, b, c, d) QxtTypeList<a, b, c, d >
91 /*! \relates QxtTypeList
92 * Declares a five-column tuple.
94 #define Qxt5TypeList(a, b, c, d, e) QxtTypeList<a, b, c, d, e >
96 /*! \relates QxtTypeList
97 * Declares a six-column tuple.
99 #define Qxt6TypeList(a, b, c, d, e, f) QxtTypeList<a, b, c, d, e, f >
101 /*! \relates QxtTypeList
102 * Declares a seven-column tuple.
104 #define Qxt7TypeList(a, b, c, d, e, f, g) QxtTypeList<a, b, c, d, e, f, g >
106 /*! \relates QxtTypeList
107 * Declares an eight-column tuple.
109 #define Qxt8TypeList(a, b, c, d, e, f, g, h) QxtTypeList<a, b, c, d, e, f, g, h >
111 /*! \relates QxtTypeList
112 * Declares a nine-column tuple.
114 #define Qxt9TypeList(a, b, c, d, e, f, g, h, i) QxtTypeList<a, b, c, d, e, f, g, h, i >
116 /*! \relates QxtTypeList
117 * Declares an extended tuple with ten or more columns. Pay special attention to the syntax of the tenth parameter, which
118 * must be a QxtTypeList, not a storage type.
120 QxtLongTypeList(int, int, int, int, int, int, int, int, int, Qxt1TypeList(int)) tuple; // correct way to implement a 10-tuple
121 QxtLongTypeList(int, int, int, int, int, int, int, int, int, int) tuple; // this will produce a (very long) compile-time error
124 #define QxtLongTypeList(a, b, c, d, e, f, g, h, i, extend) QxtTypeList<a, b, c, d, e, f, g, h, i, extend >