@@ -29,9 +29,9 @@ $(CONSOLE
29
29
language makes possible.
30
30
)
31
31
32
- $(H3 $(LNAME2 cpp-solutions, C++ Solutions))
32
+ $(H2 $(LNAME2 cpp-solutions, C++ Solutions))
33
33
34
- $(H4 The Standard C++ Solution)
34
+ $(H3 The Overload Solution)
35
35
36
36
$(P The straightforward way to do this in standard C++
37
37
is to use a series of function templates, one for
@@ -98,7 +98,7 @@ template<class T1, class T2, class T3> void print(T1 a1, T2 a2, T3 a3)
98
98
compilation.
99
99
)
100
100
101
- $(H4 C++ Variadic Templates)
101
+ $(H3 C++ Variadic Templates)
102
102
103
103
$(P C++11 supports variadic templates:
104
104
)
@@ -120,9 +120,9 @@ template<class T, class... U> void print(T a1, U... an)
120
120
A specialization with no arguments ends the recursion.
121
121
)
122
122
123
- $(H3 $(LNAME2 d-solutions, D Programming Language Solutions))
123
+ $(H2 $(LNAME2 d-solutions, D Programming Language Solutions))
124
124
125
- $(H4 The D Look Ma No Templates Solution)
125
+ $(H3 The D Look Ma No Templates Solution)
126
126
127
127
$(P It is not practical to solve this problem in C++ without
128
128
using templates. In D, one can because D supports typesafe
@@ -151,7 +151,7 @@ void print(...)
151
151
which give a pointer to the values and their types, respectively.)
152
152
)
153
153
154
- $(H4 Translating the Variadic C++ Solution into D)
154
+ $(H3 Translating the Variadic C++ Solution into D)
155
155
156
156
$(P Variadic templates in D enable a straightforward translation
157
157
of the C++11 variadic solution:
@@ -187,7 +187,7 @@ void print(T, A...)(T t, A a)
187
187
arguments by calling `print()()`.
188
188
)
189
189
190
- $(H4 The Static If Solution)
190
+ $(H3 The Static If Solution)
191
191
192
192
$(P It would be nice to encapsulate all the logic into a
193
193
single function. One way to do that is by using
@@ -213,7 +213,7 @@ void print(A...)(A a)
213
213
from any remaining elements in the original sequence.
214
214
)
215
215
216
- $(H4 The Foreach Solution)
216
+ $(H3 The Foreach Solution)
217
217
218
218
$(P But since sequences can be manipulated like arrays,
219
219
we can use a `foreach` statement to iterate over
0 commit comments