]> git.lyx.org Git - lyx.git/blob - boost/boost/preprocessor/repeat.hpp
Jrgen's "Tooltips for the reference dialog" patch. I've tried to incorporate
[lyx.git] / boost / boost / preprocessor / repeat.hpp
1 #ifndef BOOST_PREPROCESSOR_REPEAT_HPP
2 #define BOOST_PREPROCESSOR_REPEAT_HPP
3
4 /* Copyright (C) 2001
5  * Housemarque Oy
6  * http://www.housemarque.com
7  *
8  * Permission to copy, use, modify, sell and distribute this software is
9  * granted provided this copyright notice appears in all copies. This
10  * software is provided "as is" without express or implied warranty, and
11  * with no claim as to its suitability for any purpose.
12  *
13  * See http://www.boost.org for most recent version.
14  */
15
16 /** <p>Repeats the macro <code>MACRO(INDEX,DATA)</code> for <code>INDEX = [0,COUNT)</code>.</p>
17
18 <p>In other words, expands to the sequence:</p>
19
20 <pre>
21 MACRO(0,DATA) MACRO(1,DATA) ... MACRO(BOOST_PP_DEC(COUNT),DATA)
22 </pre>
23
24 <p>For example,</p>
25
26 <pre>
27 #define TEST(INDEX,DATA) DATA(INDEX);
28 BOOST_PP_REPEAT(3,TEST,X)
29 </pre>
30
31 <p>expands to:</p>
32
33 <pre>
34 X(0); X(1); X(2);
35 </pre>
36
37 <h3>2D and 3D repetition</h3>
38
39 <p>2D and 3D repetition are supported with the BOOST_PP_REPEAT_2ND() and
40 BOOST_PP_REPEAT_3RD() macros.</p>
41
42 <h3>Example</h3>
43 <ul>
44   <li><a href="../../example/duffs_device.c">duffs_device.c</a></li>
45   <li><a href="../../example/repeat_2d.c">repeat_2d.c</a></li>
46 </ul>
47
48 <h3>See</h3>
49 <ul>
50   <li>BOOST_PP_FOR()</li>
51   <li>BOOST_PP_LIMIT_MAG</li>
52 </ul>
53 */
54 #define BOOST_PP_REPEAT(COUNT,MACRO,DATA) BOOST_PP_REPEAT_DELAY(COUNT)(MACRO,DATA)
55
56 #define BOOST_PP_REPEAT_DELAY(N) BOOST_PP_REPEAT##N
57 #define BOOST_PP_REPEAT0(M,D)
58 #define BOOST_PP_REPEAT1(M,D) M(0,D)
59 #define BOOST_PP_REPEAT2(M,D) M(0,D) M(1,D)
60 #define BOOST_PP_REPEAT3(M,D) M(0,D) M(1,D) M(2,D)
61 #define BOOST_PP_REPEAT4(M,D) M(0,D) M(1,D) M(2,D) M(3,D)
62 #define BOOST_PP_REPEAT5(M,D) BOOST_PP_REPEAT4(M,D) M(4,D)
63 #define BOOST_PP_REPEAT6(M,D) BOOST_PP_REPEAT5(M,D) M(5,D)
64 #define BOOST_PP_REPEAT7(M,D) BOOST_PP_REPEAT6(M,D) M(6,D)
65 #define BOOST_PP_REPEAT8(M,D) BOOST_PP_REPEAT7(M,D) M(7,D)
66 #define BOOST_PP_REPEAT9(M,D) BOOST_PP_REPEAT8(M,D) M(8,D)
67 #define BOOST_PP_REPEAT10(M,D) BOOST_PP_REPEAT9(M,D) M(9,D)
68 #define BOOST_PP_REPEAT11(M,D) BOOST_PP_REPEAT10(M,D) M(10,D)
69 #define BOOST_PP_REPEAT12(M,D) BOOST_PP_REPEAT11(M,D) M(11,D)
70 #define BOOST_PP_REPEAT13(M,D) BOOST_PP_REPEAT12(M,D) M(12,D)
71 #define BOOST_PP_REPEAT14(M,D) BOOST_PP_REPEAT13(M,D) M(13,D)
72 #define BOOST_PP_REPEAT15(M,D) BOOST_PP_REPEAT14(M,D) M(14,D)
73 #define BOOST_PP_REPEAT16(M,D) BOOST_PP_REPEAT15(M,D) M(15,D)
74 #define BOOST_PP_REPEAT17(M,D) BOOST_PP_REPEAT16(M,D) M(16,D)
75 #define BOOST_PP_REPEAT18(M,D) BOOST_PP_REPEAT17(M,D) M(17,D)
76 #define BOOST_PP_REPEAT19(M,D) BOOST_PP_REPEAT18(M,D) M(18,D)
77 #define BOOST_PP_REPEAT20(M,D) BOOST_PP_REPEAT19(M,D) M(19,D)
78 #define BOOST_PP_REPEAT21(M,D) BOOST_PP_REPEAT20(M,D) M(20,D)
79 #define BOOST_PP_REPEAT22(M,D) BOOST_PP_REPEAT21(M,D) M(21,D)
80 #define BOOST_PP_REPEAT23(M,D) BOOST_PP_REPEAT22(M,D) M(22,D)
81 #define BOOST_PP_REPEAT24(M,D) BOOST_PP_REPEAT23(M,D) M(23,D)
82 #define BOOST_PP_REPEAT25(M,D) BOOST_PP_REPEAT24(M,D) M(24,D)
83 #define BOOST_PP_REPEAT26(M,D) BOOST_PP_REPEAT25(M,D) M(25,D)
84 #define BOOST_PP_REPEAT27(M,D) BOOST_PP_REPEAT26(M,D) M(26,D)
85 #define BOOST_PP_REPEAT28(M,D) BOOST_PP_REPEAT27(M,D) M(27,D)
86 #define BOOST_PP_REPEAT29(M,D) BOOST_PP_REPEAT28(M,D) M(28,D)
87 #define BOOST_PP_REPEAT30(M,D) BOOST_PP_REPEAT29(M,D) M(29,D)
88 #define BOOST_PP_REPEAT31(M,D) BOOST_PP_REPEAT30(M,D) M(30,D)
89 #define BOOST_PP_REPEAT32(M,D) BOOST_PP_REPEAT31(M,D) M(31,D)
90 #define BOOST_PP_REPEAT33(M,D) BOOST_PP_REPEAT32(M,D) M(32,D)
91 #define BOOST_PP_REPEAT34(M,D) BOOST_PP_REPEAT33(M,D) M(33,D)
92 #define BOOST_PP_REPEAT35(M,D) BOOST_PP_REPEAT34(M,D) M(34,D)
93 #define BOOST_PP_REPEAT36(M,D) BOOST_PP_REPEAT35(M,D) M(35,D)
94 #define BOOST_PP_REPEAT37(M,D) BOOST_PP_REPEAT36(M,D) M(36,D)
95 #define BOOST_PP_REPEAT38(M,D) BOOST_PP_REPEAT37(M,D) M(37,D)
96 #define BOOST_PP_REPEAT39(M,D) BOOST_PP_REPEAT38(M,D) M(38,D)
97 #define BOOST_PP_REPEAT40(M,D) BOOST_PP_REPEAT39(M,D) M(39,D)
98 #define BOOST_PP_REPEAT41(M,D) BOOST_PP_REPEAT40(M,D) M(40,D)
99 #define BOOST_PP_REPEAT42(M,D) BOOST_PP_REPEAT41(M,D) M(41,D)
100 #define BOOST_PP_REPEAT43(M,D) BOOST_PP_REPEAT42(M,D) M(42,D)
101 #define BOOST_PP_REPEAT44(M,D) BOOST_PP_REPEAT43(M,D) M(43,D)
102 #define BOOST_PP_REPEAT45(M,D) BOOST_PP_REPEAT44(M,D) M(44,D)
103 #define BOOST_PP_REPEAT46(M,D) BOOST_PP_REPEAT45(M,D) M(45,D)
104 #define BOOST_PP_REPEAT47(M,D) BOOST_PP_REPEAT46(M,D) M(46,D)
105 #define BOOST_PP_REPEAT48(M,D) BOOST_PP_REPEAT47(M,D) M(47,D)
106 #define BOOST_PP_REPEAT49(M,D) BOOST_PP_REPEAT48(M,D) M(48,D)
107 #define BOOST_PP_REPEAT50(M,D) BOOST_PP_REPEAT49(M,D) M(49,D)
108 #define BOOST_PP_REPEAT51(M,D) BOOST_PP_REPEAT50(M,D) M(50,D)
109 #define BOOST_PP_REPEAT52(M,D) BOOST_PP_REPEAT51(M,D) M(51,D)
110 #define BOOST_PP_REPEAT53(M,D) BOOST_PP_REPEAT52(M,D) M(52,D)
111 #define BOOST_PP_REPEAT54(M,D) BOOST_PP_REPEAT53(M,D) M(53,D)
112 #define BOOST_PP_REPEAT55(M,D) BOOST_PP_REPEAT54(M,D) M(54,D)
113 #define BOOST_PP_REPEAT56(M,D) BOOST_PP_REPEAT55(M,D) M(55,D)
114 #define BOOST_PP_REPEAT57(M,D) BOOST_PP_REPEAT56(M,D) M(56,D)
115 #define BOOST_PP_REPEAT58(M,D) BOOST_PP_REPEAT57(M,D) M(57,D)
116 #define BOOST_PP_REPEAT59(M,D) BOOST_PP_REPEAT58(M,D) M(58,D)
117 #define BOOST_PP_REPEAT60(M,D) BOOST_PP_REPEAT59(M,D) M(59,D)
118 #define BOOST_PP_REPEAT61(M,D) BOOST_PP_REPEAT60(M,D) M(60,D)
119 #define BOOST_PP_REPEAT62(M,D) BOOST_PP_REPEAT61(M,D) M(61,D)
120 #define BOOST_PP_REPEAT63(M,D) BOOST_PP_REPEAT62(M,D) M(62,D)
121 #define BOOST_PP_REPEAT64(M,D) BOOST_PP_REPEAT63(M,D) M(63,D)
122 #define BOOST_PP_REPEAT65(M,D) BOOST_PP_REPEAT64(M,D) M(64,D)
123 #define BOOST_PP_REPEAT66(M,D) BOOST_PP_REPEAT65(M,D) M(65,D)
124 #define BOOST_PP_REPEAT67(M,D) BOOST_PP_REPEAT66(M,D) M(66,D)
125 #define BOOST_PP_REPEAT68(M,D) BOOST_PP_REPEAT67(M,D) M(67,D)
126 #define BOOST_PP_REPEAT69(M,D) BOOST_PP_REPEAT68(M,D) M(68,D)
127 #define BOOST_PP_REPEAT70(M,D) BOOST_PP_REPEAT69(M,D) M(69,D)
128 #define BOOST_PP_REPEAT71(M,D) BOOST_PP_REPEAT70(M,D) M(70,D)
129 #define BOOST_PP_REPEAT72(M,D) BOOST_PP_REPEAT71(M,D) M(71,D)
130 #define BOOST_PP_REPEAT73(M,D) BOOST_PP_REPEAT72(M,D) M(72,D)
131 #define BOOST_PP_REPEAT74(M,D) BOOST_PP_REPEAT73(M,D) M(73,D)
132 #define BOOST_PP_REPEAT75(M,D) BOOST_PP_REPEAT74(M,D) M(74,D)
133 #define BOOST_PP_REPEAT76(M,D) BOOST_PP_REPEAT75(M,D) M(75,D)
134 #define BOOST_PP_REPEAT77(M,D) BOOST_PP_REPEAT76(M,D) M(76,D)
135 #define BOOST_PP_REPEAT78(M,D) BOOST_PP_REPEAT77(M,D) M(77,D)
136 #define BOOST_PP_REPEAT79(M,D) BOOST_PP_REPEAT78(M,D) M(78,D)
137 #define BOOST_PP_REPEAT80(M,D) BOOST_PP_REPEAT79(M,D) M(79,D)
138 #define BOOST_PP_REPEAT81(M,D) BOOST_PP_REPEAT80(M,D) M(80,D)
139 #define BOOST_PP_REPEAT82(M,D) BOOST_PP_REPEAT81(M,D) M(81,D)
140 #define BOOST_PP_REPEAT83(M,D) BOOST_PP_REPEAT82(M,D) M(82,D)
141 #define BOOST_PP_REPEAT84(M,D) BOOST_PP_REPEAT83(M,D) M(83,D)
142 #define BOOST_PP_REPEAT85(M,D) BOOST_PP_REPEAT84(M,D) M(84,D)
143 #define BOOST_PP_REPEAT86(M,D) BOOST_PP_REPEAT85(M,D) M(85,D)
144 #define BOOST_PP_REPEAT87(M,D) BOOST_PP_REPEAT86(M,D) M(86,D)
145 #define BOOST_PP_REPEAT88(M,D) BOOST_PP_REPEAT87(M,D) M(87,D)
146 #define BOOST_PP_REPEAT89(M,D) BOOST_PP_REPEAT88(M,D) M(88,D)
147 #define BOOST_PP_REPEAT90(M,D) BOOST_PP_REPEAT89(M,D) M(89,D)
148 #define BOOST_PP_REPEAT91(M,D) BOOST_PP_REPEAT90(M,D) M(90,D)
149 #define BOOST_PP_REPEAT92(M,D) BOOST_PP_REPEAT91(M,D) M(91,D)
150 #define BOOST_PP_REPEAT93(M,D) BOOST_PP_REPEAT92(M,D) M(92,D)
151 #define BOOST_PP_REPEAT94(M,D) BOOST_PP_REPEAT93(M,D) M(93,D)
152 #define BOOST_PP_REPEAT95(M,D) BOOST_PP_REPEAT94(M,D) M(94,D)
153 #define BOOST_PP_REPEAT96(M,D) BOOST_PP_REPEAT95(M,D) M(95,D)
154 #define BOOST_PP_REPEAT97(M,D) BOOST_PP_REPEAT96(M,D) M(96,D)
155 #define BOOST_PP_REPEAT98(M,D) BOOST_PP_REPEAT97(M,D) M(97,D)
156 #define BOOST_PP_REPEAT99(M,D) BOOST_PP_REPEAT98(M,D) M(98,D)
157 #define BOOST_PP_REPEAT100(M,D) BOOST_PP_REPEAT99(M,D) M(99,D)
158 #define BOOST_PP_REPEAT101(M,D) BOOST_PP_REPEAT100(M,D) M(100,D)
159 #define BOOST_PP_REPEAT102(M,D) BOOST_PP_REPEAT101(M,D) M(101,D)
160 #define BOOST_PP_REPEAT103(M,D) BOOST_PP_REPEAT102(M,D) M(102,D)
161 #define BOOST_PP_REPEAT104(M,D) BOOST_PP_REPEAT103(M,D) M(103,D)
162 #define BOOST_PP_REPEAT105(M,D) BOOST_PP_REPEAT104(M,D) M(104,D)
163 #define BOOST_PP_REPEAT106(M,D) BOOST_PP_REPEAT105(M,D) M(105,D)
164 #define BOOST_PP_REPEAT107(M,D) BOOST_PP_REPEAT106(M,D) M(106,D)
165 #define BOOST_PP_REPEAT108(M,D) BOOST_PP_REPEAT107(M,D) M(107,D)
166 #define BOOST_PP_REPEAT109(M,D) BOOST_PP_REPEAT108(M,D) M(108,D)
167 #define BOOST_PP_REPEAT110(M,D) BOOST_PP_REPEAT109(M,D) M(109,D)
168 #define BOOST_PP_REPEAT111(M,D) BOOST_PP_REPEAT110(M,D) M(110,D)
169 #define BOOST_PP_REPEAT112(M,D) BOOST_PP_REPEAT111(M,D) M(111,D)
170 #define BOOST_PP_REPEAT113(M,D) BOOST_PP_REPEAT112(M,D) M(112,D)
171 #define BOOST_PP_REPEAT114(M,D) BOOST_PP_REPEAT113(M,D) M(113,D)
172 #define BOOST_PP_REPEAT115(M,D) BOOST_PP_REPEAT114(M,D) M(114,D)
173 #define BOOST_PP_REPEAT116(M,D) BOOST_PP_REPEAT115(M,D) M(115,D)
174 #define BOOST_PP_REPEAT117(M,D) BOOST_PP_REPEAT116(M,D) M(116,D)
175 #define BOOST_PP_REPEAT118(M,D) BOOST_PP_REPEAT117(M,D) M(117,D)
176 #define BOOST_PP_REPEAT119(M,D) BOOST_PP_REPEAT118(M,D) M(118,D)
177 #define BOOST_PP_REPEAT120(M,D) BOOST_PP_REPEAT119(M,D) M(119,D)
178 #define BOOST_PP_REPEAT121(M,D) BOOST_PP_REPEAT120(M,D) M(120,D)
179 #define BOOST_PP_REPEAT122(M,D) BOOST_PP_REPEAT121(M,D) M(121,D)
180 #define BOOST_PP_REPEAT123(M,D) BOOST_PP_REPEAT122(M,D) M(122,D)
181 #define BOOST_PP_REPEAT124(M,D) BOOST_PP_REPEAT123(M,D) M(123,D)
182 #define BOOST_PP_REPEAT125(M,D) BOOST_PP_REPEAT124(M,D) M(124,D)
183 #define BOOST_PP_REPEAT126(M,D) BOOST_PP_REPEAT125(M,D) M(125,D)
184 #define BOOST_PP_REPEAT127(M,D) BOOST_PP_REPEAT126(M,D) M(126,D)
185 #define BOOST_PP_REPEAT128(M,D) BOOST_PP_REPEAT127(M,D) M(127,D)
186
187 /* <p>Obsolete. Use BOOST_PP_REPEAT().</p> */
188 #define BOOST_PREPROCESSOR_REPEAT(C,M,D) BOOST_PP_REPEAT(C,M,D)
189 #endif