@@ -83,8 +83,9 @@ T foo(T i)
83
83
84
84
$(TR
85
85
$(TD Parameterize any Declaration)
86
- $(TD Yes, classes, functions, typedefs,
87
- variables, enums, etc. can be parameterized,
86
+ $(TD Yes, classes, functions, any
87
+ $(DDSUBLINK spec/declaration, alias, alias),
88
+ variables, any enum, etc. can be parameterized,
88
89
such as this variable:
89
90
---
90
91
template Foo(T)
@@ -97,7 +98,14 @@ template Foo(T)
97
98
$(B$(U C++98))$(BR)
98
99
No, only classes and functions
99
100
$(BR)$(B$(U C++11))$(BR)
100
- Yes:
101
+ Added `using` type aliases:
102
+ $(CPPCODE2
103
+ template<class T>
104
+ using ptr = T*;
105
+ ptr<int> p;
106
+ )
107
+ $(B$(U C++14))$(BR)
108
+ Added `constexpr` constant:
101
109
$(CPPCODE2
102
110
template<class T>
103
111
constexpr T pi = T(3.1415926535897932385L);
@@ -133,7 +141,8 @@ MyFoo<unsigned> f;
133
141
134
142
$(TR
135
143
$(TD Sequence Constructors)
136
- $(TD No)
144
+ $(TD No, use a
145
+ $(DDSUBLINK spec/function, typesafe_variadic_functions, variadic parameter) instead)
137
146
$(TD
138
147
$(B$(U C++98))$(BR)
139
148
No
@@ -259,8 +268,8 @@ template<class T, int maxLength> class HashTable {
259
268
)
260
269
261
270
$(TR
262
- $(TD Template Declarations (with no definition) )
263
- $(TD No )
271
+ $(TD Template Forward Declarations )
272
+ $(TD Not necessary )
264
273
$(TD Yes:
265
274
$(CPPCODE2
266
275
template<class T>
@@ -295,6 +304,12 @@ return Foo<char, int>::foo('c', 3);
295
304
)
296
305
)
297
306
307
+ $(TR
308
+ $(TD Deducing `this` parameter type)
309
+ $(TD $(DDSUBLINK spec/template, template_this_parameter, Yes))
310
+ $(TD $(B$(U C++23))$(BR)Yes)
311
+ )
312
+
298
313
$(TR
299
314
$(TD Compile time execution of functions)
300
315
$(TD $(DDSUBLINK spec/function, interpretation, Yes):
@@ -376,7 +391,7 @@ void foo()
376
391
377
392
$(TR
378
393
$(TD Reference Parameters)
379
- $(TD No, D does not have a general reference type )
394
+ $(TD No, but an alias parameter can be used instead (see below). )
380
395
$(TD Yes:
381
396
$(CPPCODE2
382
397
template<double& D>
0 commit comments