forked from dlang/dlang.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpp0x.dd
737 lines (543 loc) · 19.1 KB
/
cpp0x.dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
Ddoc
$(COMMUNITY D and C++0x,
$(P
C++ is undergoing an upgrade to a new standard, commonly referred
to as C++0x.
This article covers the highlights of
$(LINK2 $(NDOCS)2008/n2597.html, C++0x core language changes)
and compares them with what is available in D.
Since C++0x is far from being finalized,
this article is subject to being obsoleted by new proposals and
revisions to existing ones.
C++0x standard library changes are not addressed here.
TBD means To Be Determined.
)
$(SECTION3 Proposed C++0x Features,
$(UL
$(LI $(RELATIVE_LINK2 rvalue-reference, A Proposal to Add an Rvalue Reference to the C++ Language))
$(LI $(RELATIVE_LINK2 class-rvalue, Clarification of Initialization of Class Objects by rvalues))
$(LI $(RELATIVE_LINK2 move-semantics, Extending Move Semantics To *this (Revision 2)))
$(LI $(RELATIVE_LINK2 static-assert, static_assert))
$(LI $(RELATIVE_LINK2 template-aliases, Template aliases for C++))
$(LI $(RELATIVE_LINK2 extern-template, Extern template))
$(LI $(RELATIVE_LINK2 variadic-templates, Variadic Templates))
$(LI $(RELATIVE_LINK2 variadic-template-templates, Extending Variadic Template Template Parameters))
$(LI $(RELATIVE_LINK2 nullptr, A name for the null pointer: nullptr))
$(LI $(RELATIVE_LINK2 strong-enums, Strongly Typed Enums))
$(LI $(RELATIVE_LINK2 extended-friends, Extended friend Declarations))
$(LI $(RELATIVE_LINK2 constant-expressions, Generalized Constant Expressions))
$(LI $(RELATIVE_LINK2 namespace-association, Namespace Association ("Strong Using")))
$(LI $(RELATIVE_LINK2 c99-preprocessor, Synchronizing the C++ preprocessor with C99))
$(LI $(RELATIVE_LINK2 alignment, Adding Alignment Support to the C++ Programming Language))
$(LI $(RELATIVE_LINK2 conditional, Conditionally-Supported Behavior))
$(LI $(RELATIVE_LINK2 undefined-behavior, Changing Undefined Behavior into Diagnosable Errors))
$(LI $(RELATIVE_LINK2 long-long, Adding the long long type to C++))
$(LI $(RELATIVE_LINK2 extended-integer-types, Adding extended integer types to C++))
$(LI $(RELATIVE_LINK2 delegating-ctors, Delegating Constructors))
$(LI $(RELATIVE_LINK2 explicit-conversion, Explicit Conversion Operators))
$(LI $(RELATIVE_LINK2 char16_t, New Character Types in C++))
$(LI $(RELATIVE_LINK2 right-angle-brackets, Right Angle Brackets))
$(LI $(RELATIVE_LINK2 type-deduction, Deducing the type of variable from its initializer expression))
$(LI $(RELATIVE_LINK2 auto-declarations, The Syntax of auto Declarations))
$(LI $(RELATIVE_LINK2 inheriting-ctors, Inheriting Constructors))
$(LI $(RELATIVE_LINK2 sequence-points, A finer-grained alternative to sequence points))
$(LI $(RELATIVE_LINK2 lambda, (monomorphic) Lambda expressions and closures for C++))
$(LI $(RELATIVE_LINK2 func, Proposed addition of __func__ predefined identifier from C99))
$(LI $(RELATIVE_LINK2 atomic, Atomic operations with multi-threaded environments))
$(LI $(RELATIVE_LINK2 concurrency, Sequencing and the concurrency memory model))
$(LI $(RELATIVE_LINK2 raw-strings, Raw String Literals))
$(LI $(RELATIVE_LINK2 pod, PODs unstrung))
$(LI $(RELATIVE_LINK2 exceptions, Propagating exceptions when joining threads))
$(LI $(RELATIVE_LINK2 decltype, Decltype))
$(LI $(RELATIVE_LINK2 sizeof, Extending sizeof))
$(LI $(RELATIVE_LINK2 utf8-literals, UTF8 Literals))
$(LI $(RELATIVE_LINK2 ucs-in-literals, Universal Character Names in Literals))
$(LI $(RELATIVE_LINK2 defaulted, Defaulted and Deleted Functions))
$(LI $(RELATIVE_LINK2 unions, Unrestricted Unions))
$(LI $(RELATIVE_LINK2 library, A Multi-threading Library for Standard C++))
$(LI $(RELATIVE_LINK2 abandoning, Abandoning a Process))
$(LI $(RELATIVE_LINK2 return-types, New function declaration syntax for deduced return types))
$(LI $(RELATIVE_LINK2 atomic-signals, Allow atomics use in signal handlers))
)
$(UL
$(LI $(RELATIVE_LINK2 local-classes, Making Local Classes more Useful))
$(LI $(RELATIVE_LINK2 initializer-lists, Initializer lists))
$(LI $(RELATIVE_LINK2 thread-local-storage, Thread-Local Storage))
$(LI $(RELATIVE_LINK2 member-initializers, Member Initializers))
$(LI $(RELATIVE_LINK2 concepts, Concepts (unified proposal)))
$(LI $(RELATIVE_LINK2 for-loop, Proposal for new for-loop))
$(LI $(RELATIVE_LINK2 general-attributes, General Attributes for C++))
)
$(UL
$(LI $(RELATIVE_LINK2 extensible-literals, Extensible Literals))
$(LI $(RELATIVE_LINK2 dynamic-concurrency, Dynamic initialization and concurrency))
$(LI $(RELATIVE_LINK2 garbage-collection, Minimal Support for Garbage Collection and Reachability-Based Leak Detection))
$(LI $(RELATIVE_LINK2 forward-enums, Forward declaration of enumerations))
)
)
$(SECTION3 $(LNAME2 rvalue-reference, A Proposal to Add an Rvalue Reference to the C++ Language),
$(P $(LINK2 $(NDOCS)2005/n1770.html, N1770): TBD
)
)
$(SECTION3 $(LNAME2 class-rvalue, Clarification of Initialization of Class Objects by rvalues),
$(P $(LINK2 $(NDOCS)2004/n1610.html, N1610): TBD
)
)
$(SECTION3 $(LNAME2 move-semantics, Extending Move Semantics To *this (Revision 2)),
$(P $(LINK2 $(NDOCS)2007/n2439.htm, N2439): TBD
)
)
$(SECTION3 $(LNAME2 static-assert, static_assert),
$(P $(LINK2 $(NDOCS)2004/n1720.html, N1720):
$(DDSUBLINK version, StaticAssert, static assert) is
part of D.
)
)
$(SECTION3 $(LNAME2 template-aliases, Template aliases for C++),
$(P $(LINK2 $(NDOCS)2007/n2258.pdf, N2258):
Both $(LINK2 template.html, templates and template instantiations)
can be $(DDSUBLINK declaration, alias, aliased):
)
---
struct S(T) { T int; }
alias X = S; // alias template
alias Y = S!(int); // alias template instantiation
X!(int) x;
Y y; // x and y are the same type
---
)
$(SECTION3 $(LNAME2 extern-template, Extern template),
$(P $(LINK2 $(NDOCS)2006/n1987.htm, N1987):
This is a workaround for problems in the traditional compile/link
build model.
The D compiler deals with this by if multiple modules are compiled
at the same time, only one instance of a template is generated
for all the generated object files rather than one instance in each
object file. Further improvements are planned for generating library
modules that avoid multiple redundant template instantiations.
)
)
$(SECTION3 $(LNAME2 variadic-templates, Variadic Templates),
$(P $(LINK2 $(NDOCS)2007/n2242.pdf, N2242):
D's $(DDSUBLINK template, variadic-templates, variadic templates).
)
)
$(SECTION3 $(LNAME2 variadic-template-templates, Extending Variadic Template Template Parameters),
$(P $(LINK2 $(NDOCS)2008/n2555.pdf, N2555): TBD
)
)
$(SECTION3 $(LNAME2 nullptr, A name for the null pointer: nullptr),
$(P $(LINK2 $(NDOCS)2007/n2431.pdf, N2431):
D has the $(DDSUBLINK expression, null, null) equivalent.
)
)
$(SECTION3 $(LNAME2 strong-enums, Strongly Typed Enums),
$(P $(LINK2 $(NDOCS)2007/n2347.pdf, N2347):
D $(LINK2 enum.html, enums) are:
)
$(OL
$(LI Comparisons between different enum types should be an error,
but is not:
---
void main()
{
enum Color { ClrRed, ClrOrange, ClrYellow, ClrGreen, ClrBlue, ClrViolet };
enum Alert { CndGreen, CndYellow, CndRed };
Color c = Color.ClrRed;
Alert a = Alert.CndGreen;
a = c; // error
a = Color.ClrYellow; // error
bool armWeapons = ( a >= Color.ClrYellow ); // ok; oops
}
---
)
$(LI The underlying type can be specified.)
$(LI Named enums are strongly scoped. Anonymous enum members are
declared in the enclosing scope.)
$(LI Explicit qualification is needed to specify a named enum
member.)
)
)
$(SECTION3 $(LNAME2 extended-friends, Extended friend Declarations),
$(P $(LINK2 $(NDOCS)2005/n1791.pdf, N1791):
All code in a module has
$(DDSUBLINK attribute, ProtectionAttribute, access)
to private members
of any struct or class declared in that module that is in
scope.
Package protected members can be accessed by any code in the
same package.
There is no need in D to have friend declarations or
complex lookup rules for them.
)
)
$(SECTION3 $(LNAME2 constant-expressions, Generalized Constant Expressions),
$(P $(LINK2 $(NDOCS)2007/n2235.pdf, N2235):
D has $(DDSUBLINK function, interpretation, compile time function execution)
(CTFE). CTFE is much more flexible, as functions to be evaluated
at compile time:
)
$(OL
$(LI do not require a special keyword (C++0x requires $(CODE constexpr)))
$(LI can have multiple statements in the function)
$(LI can be recursive)
$(LI can modify local variables)
$(LI can have out parameters)
)
)
$(SECTION3 $(LNAME2 namespace-association, Namespace Association ("Strong Using")),
$(P $(LINK2 $(NDOCS)2008/n2535.html, N2535):
D doesn't have namespaces,
so this is irrelevant.
)
)
$(SECTION3 $(LNAME2 c99-preprocessor, Synchronizing the C++ preprocessor with C99),
$(P $(LINK2 $(NDOCS)2004/n1653.htm, N1653):
D does not have a preprocessor,
so this is not relevant to D.
)
)
$(SECTION3 $(LNAME2 alignment, Adding Alignment Support to the C++ Programming Language),
$(P $(LINK2 $(NDOCS)2007/n2341.pdf, N2341):
D has the $(DDSUBLINK attribute, align, align)
attribute to specify the alignment
of declarations, and the $(DDSUBLINK property, alignof, .alignof)
property to
determine the alignment size of an expression or type.
)
)
$(SECTION3 $(LNAME2 conditional, Conditionally-Supported Behavior),
$(P $(LINK2 $(NDOCS)2004/n1627.pdf, N1627):
There are some allowed vendor specific behaviors in D,
such as $(LINK2 pragma.html, pragmas).
)
)
$(SECTION3 $(LNAME2 undefined-behavior, Changing Undefined Behavior into Diagnosable Errors),
$(P $(LINK2 $(NDOCS)2004/n1727.pdf, N1727):
D does not have undefined behavior with integer literal types,
character escapes, or passing non-POD objects to ellipses.
)
)
$(SECTION3 $(LNAME2 long-long, Adding the long long type to C++),
$(P $(LINK2 $(NDOCS)2005/n1811.pdf, N1811):
D's $(LINK2 type.html, long) type is equivalent.
)
)
$(SECTION3 $(LNAME2 extended-integer-types, Adding extended integer types to C++),
$(P $(LINK2 $(NDOCS)2006/n1988.pdf, N1988):
D has the $(LINK2 type.html, cent and
ucent) types for
128 bit integral types (not implemented in dmd or gdc).
There is no proposal for other extended
integral types, but it's hard to imagine a justification for
adding more to the core language.
)
)
$(SECTION3 $(LNAME2 delegating-ctors, Delegating Constructors),
$(P $(LINK2 $(NDOCS)2006/n1986.pdf, N1986):
D has
$(DDSUBLINK class, delegating-constructors, delegating constructors).
)
)
$(SECTION3 $(LNAME2 explicit-conversion, Explicit Conversion Operators),
$(P $(LINK2 $(NDOCS)2007/n2437.html, N2437): TBD
)
)
$(SECTION3 $(LNAME2 char16_t, New Character Types in C++),
$(P $(LINK2 $(NDOCS)2007/n2249.html, N2249):
C++0x adds new character types char16_t and char32_t,
which are equivalent to D's $(LINK2 type.html, wchar and dchar types).
The u and U character literal prefixes are equivalent to the
D $(DDSUBLINK lex, StringLiteral, w and d postfixes).
)
)
$(SECTION3 $(LNAME2 right-angle-brackets, Right Angle Brackets),
$(P $(LINK2 $(NDOCS)2005/n1757.html, N1757):
Since D uses !( ) to instantiate templates rather than
< >, there are no parsing ambiguities and
no fixes are necessary.
)
)
$(SECTION3 $(LNAME2 type-deduction, Deducing the type of variable from its initializer expression),
$(P $(LINK2 $(NDOCS)2006/n1984.pdf, N1984):
D has $(DDSUBLINK declaration, AutoDeclaration, type inference)
from initializers.
)
)
$(SECTION3 $(LNAME2 auto-declarations, The Syntax of auto Declarations),
$(P $(LINK2 $(NDOCS)2008/n2546.html, N2546):
D $(DDSUBLINK attribute, auto, auto declarations)
do not have syntactic issues.
)
)
$(SECTION3 $(LNAME2 inheriting-ctors, Inheriting Constructors),
$(P $(LINK2 $(NDOCS)2008/n2540.html, N2540): TBD
)
)
$(SECTION3 $(LNAME2 sequence-points, A finer-grained alternative to sequence points),
$(P $(LINK2 $(NDOCS)2007/n2239.htm, N2239): TBD
)
)
$(SECTION3 $(LNAME2 lambda, (monomorphic) Lambda expressions and closures for C++),
$(P $(LINK2 $(NDOCS)2008/n2550.pdf, N2550):
D has $(GLINK2 expression, FunctionLiteral)s (lambda expressions) and
$(DDSUBLINK function, closures, closures).
)
)
$(SECTION3 $(LNAME2 func, Proposed addition of __func__ predefined identifier from C99),
$(P $(LINK2 $(NDOCS)2007/n2340.html, N2340): TBD
)
)
$(SECTION3 $(LNAME2 atomic, Atomic operations with multi-threaded environments),
$(P $(LINK2 $(NDOCS)2007/n2427.html, N2427): TBD
)
)
$(SECTION3 $(LNAME2 concurrency, Sequencing and the concurrency memory model),
$(P $(LINK2 $(NDOCS)2007/n2429.htm, N2429): TBD
)
)
$(SECTION3 $(LNAME2 raw-strings, Raw String Literals),
$(P $(LINK2 $(NDOCS)2007/n2442.html, N2442):
D has $(DDSUBLINK lex, StringLiteral, wysiwyg and delimited strings),
and all strings are Unicode.
)
)
$(SECTION3 $(LNAME2 pod, PODs unstrung),
$(P $(LINK2 $(NDOCS)2007/n2294.html, N2294):
All D $(LINK2 struct.html, structs) are
$(DDSUBLINK glossary, pod, POD (Plain Old Data)).
D $(LINK2 class.html, classes) are reference, polymorphic types.
)
)
$(SECTION3 $(LNAME2 exceptions, Propagating exceptions when joining threads),
$(P $(LINK2 $(NDOCS)2007/n2179.html, N2179): TBD
)
)
$(SECTION3 $(LNAME2 decltype, Decltype),
$(P $(LINK2 $(NDOCS)2007/n2343.pdf, N2343):
The equivalent D construct is $(DDSUBLINK declaration, typeof, typeof).
)
)
$(SECTION3 $(LNAME2 sizeof, Extending sizeof),
$(P $(LINK2 $(NDOCS)2007/n2253.html, N2253):
Using $(DDSUBLINK property sizeof, sizeof) without a $(I this) object:
---
struct S
{
int a;
static int foo()
{
return a.sizeof;
}
}
void test()
{
int x = S.a.sizeof;
}
---
works correctly in D.
)
)
$(SECTION3 $(LNAME2 utf8-literals, UTF-8 Literals),
$(P $(LINK2 $(NDOCS)2007/n2442.html, N2442):
$(DDSUBLINK lex, StringLiteral, Char string literals)
are in UTF-8 format.
)
)
$(SECTION3 $(LNAME2 ucs-in-literals, Universal Character Names in Literals),
$(P $(LINK2 $(NDOCS)2007/n2170.html, N2170):
All Unicode characters are allowed in
$(DDSUBLINK lex, StringLiteral, string literals).
Surrogate pair halves are not allowed unless hex literal notation
is used.
)
)
$(SECTION3 $(LNAME2 defaulted, Defaulted and Deleted Functions),
$(P $(DDSUBLINK $(NDOCS)2007/n2326, delete, N2326):
D alows individual functions to be marked as $(DDSUBLINK attribute, disable, disabled).
)
)
$(SECTION3 $(LNAME2 unions, Unrestricted Unions),
$(P $(LINK2 $(NDOCS)2008/n2544.pdf, N2544): TBD
)
)
$(SECTION3 $(LNAME2 library, A Multi-threading Library for Standard C++),
$(P $(LINK2 $(NDOCS)2007/n2447.html, N2447): TBD
)
)
$(SECTION3 $(LNAME2 abandoning, Abandoning a Process),
$(P $(LINK2 $(NDOCS)2007/n2440.html, N2440): TBD
)
)
$(SECTION3 $(LNAME2 return-types, New function declaration syntax for deduced return types),
$(P $(LINK2 $(NDOCS)2007/n2445.html, N2445): TBD
)
)
$(SECTION3 $(LNAME2 atomic-signals, Allow atomics use in signal handlers),
$(P $(LINK2 $(NDOCS)2008/n2547.htm, N2547): TBD
)
)
$(SECTION3 $(LNAME2 local-classes, Making Local Classes more Useful),
$(P $(LINK2 $(NDOCS)2007/n2402.pdf, N2402):
D has no restrictions on using local classes as template
parameters.
)
)
$(SECTION3 $(LNAME2 initializer-lists, Initializer lists),
$(P $(LINK2 $(NDOCS)2008/n2531.pdf, N2531):
D has
$(DDSUBLINK struct, StructLiteral, struct literals),
$(DDSUBLINK expression, ArrayLiteral, array literals),
and $(DDSUBLINK expression, AssocArrayLiteral, associative array literals).
)
)
$(SECTION3 $(LNAME2 thread-local-storage, Thread-Local Storage),
$(P $(LINK2 $(NDOCS)2007/n2280.html, N2280):
Thread-local storage is the default for statics and globals
in D. Thread-global storage is done by using the
$(LINK2 migrate-to-shared.html, $(B shared))
storage class.
)
)
$(SECTION3 $(LNAME2 member-initializers, Member Initializers),
$(P $(LINK2 $(NDOCS)2007/n2426.htm, N2426):
D has
$(DDSUBLINK class, class-default-initializer, member initializers),
which are called $(I default initializers).
)
)
$(SECTION3 $(LNAME2 concepts, Concepts (unified proposal)),
$(P $(LINK2 $(NDOCS)2006/n2081.pdf, N2081):
The D equivalent of C++ concepts are $(LINK2 concepts.html, constraints).
(As of $(LINK2 http://www.ddj.com/cpp/218600111, July 2009),
Concepts have been dropped from C++0x.)
)
$(TABLE2 Concepts and Constraints,
$(TR
$(TH Description)
$(TH D Constraints)
$(TH C++0x Concepts)
)
$(TR
$(TD Overloading based on concepts/constraints)
$(TD Yes)
$(TD Yes)
)
$(TR
$(TD Concepts/constraints on template type parameters)
$(TD Yes)
$(TD Yes)
)
$(TR
$(TD Concepts/constraints on template value parameters)
$(TD Yes)
$(TD No)
)
$(TR
$(TD Concepts/constraints on template template/alias parameters)
$(TD Yes)
$(TD No)
)
$(TR
$(TD Composition and refinement of concepts/constraints)
$(TD Yes)
$(TD Yes)
)
$(TR
$(TD Multi-type concepts/constraints)
$(TD Yes)
$(TD Yes)
)
$(TR
$(TD Expression of concepts/constraints)
$(TD Done with compile time expressions)
$(TD Done by enumeration of function signatures)
)
$(TR
$(TD Axioms)
$(TD Yes (as static asserts and function preconditions))
$(TD Yes)
)
$(TR
$(TD new keywords)
$(TD No)
$(TD Yes: where, concept, concept_map, axiom, late_check)
)
$(TR
$(TD Semantic analysis of template bodies)
$(TD Lazy (done at instantiation time))
$(TD Eager (done at definition time))
)
$(TR
$(TD Template body checked against concept/constraint)
$(TD No)
$(TD Yes)
)
$(TR
$(TD Concept maps)
$(TD No (but could be done with proxy objects))
$(TD Yes)
)
$(TR
$(TD All operations on constrained types must be specified in
concept/constraint)
$(TD No)
$(TD Yes)
)
$(TR
$(TD Complexity)
$(TD $(CODE if (expression)) added to template grammar)
$(TD quite a bit of new grammar and semantics added)
)
)
)
$(SECTION3 $(LNAME2 for-loop, Proposal for new for-loop),
$(P $(LINK2 $(NDOCS)2007/n2394.html, N2394):
This is equivalent to the D
$(DDSUBLINK statement, ForeachRangeStatement, $(I ForeachRangeStatement)).
)
)
$(SECTION3 $(LNAME2 general-attributes, General Attributes for C++),
$(P $(LINK2 $(NDOCS)2007/n2418.pdf, N2418):
Vendor specific attributes can be applied to statements
and declarations with
$(LINK2 pragma.html, pragmas).
)
)
$(SECTION3 $(LNAME2 extensible-literals, Extensible Literals),
$(P $(LINK2 $(NDOCS)2007/n2378.pdf, N2378):
D does not have user extensible literals.
)
)
$(SECTION3 $(LNAME2 dynamic-concurrency, Dynamic initialization and concurrency),
$(P $(LINK2 $(NDOCS)2008/n2513.html, N2513): TBD
)
)
$(SECTION3 $(LNAME2 garbage-collection, Minimal Support for Garbage Collection and Reachability-Based Leak Detection),
$(P $(LINK2 $(NDOCS)2008/n2527.html, N2527):
Garbage collection is optional in C++0x,
D $(LINK2 garbage.html, requires it).
The problem with an optional garbage collector is that in order
to write general purpose libraries, one must assume that there is
no garbage collector, therefore none of the productivity enhancing
advantages of it are available.
)
)
$(SECTION3 $(LNAME2 forward-enums, Forward declaration of enumerations),
$(P $(LINK2 $(NDOCS)2008/n2499.pdf, N2499):
Forward declarations are not necessary in D, as all declarations
are resolved essentially in parallel.
Incomplete $(LINK2 enum.html, enum) types, however, are possible:
)
---
enum E : int;
---
$(P where the member values are hidden from the user.
)
)
)
Macros:
TITLE=D and C++0x
DOLLAR=$
NDOCS=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/
_=