Skip to content

Commit 5d84a31

Browse files
authored
Merge pull request #2103 from WalterBright/rm-comparisons
remove comparisons to C++
2 parents 5c8038d + 624bd7d commit 5d84a31

File tree

6 files changed

+5
-87
lines changed

6 files changed

+5
-87
lines changed

spec/contracts.dd

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ $(HEADERNAV_TOC)
77
$(P Contracts are a breakthrough technique to reduce the programming effort
88
for large projects. Contracts are the concept of preconditions, postconditions,
99
errors, and invariants.
10-
Contracts can be done in C++ without modification to the language,
11-
but the result is
12-
clumsy and inconsistent.)
10+
)
1311

1412
$(P Building contract support into the language makes for:)
1513

spec/expression.dd

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ $(SPEC_S Expressions,
44

55
$(HEADERNAV_TOC)
66

7-
$(P C and C++ programmers will find the D expressions very familiar,
8-
with a few interesting additions.
9-
)
10-
117
$(P Expressions are used to compute values with a resulting type.
128
These values can then be assigned,
139
tested, or ignored. Expressions can also have side effects.
@@ -16,9 +12,7 @@ $(HEADERNAV_TOC)
1612
$(H2 $(LNAME2 order-of-evaluation, Order Of Evaluation))
1713

1814
$(P Binary expressions and function arguments are evaluated in strictly
19-
left-to-right order. This is similar to Java but different to C and C++, where
20-
the evaluation order is unspecified. Thus, the following code is valid and well
21-
defined.)
15+
left-to-right order.)
2216

2317
-------------
2418
import std.conv;
@@ -622,7 +616,7 @@ $(GNAME ComplementExpression):
622616
All the bits in the value are complemented.
623617
)
624618

625-
$(P $(B Note:) unlike in C and C++, the usual integral promotions are not performed
619+
$(P $(B Note:) the usual integral promotions are not performed
626620
prior to the complement operation.
627621
)
628622

@@ -764,9 +758,6 @@ $(GNAME CastExpression):
764758
really is a downcast. $(D null) is the result if it isn't.
765759
)
766760

767-
$(P $(B Note:) This is equivalent to the behavior of the
768-
$(D dynamic_cast) operator in C++.)
769-
770761
-------------
771762
class A { ... }
772763
class B : A { ... }

spec/garbage.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $(HEADERNAV_TOC)
1414
is $(B not involved). More information is provided below.
1515
)
1616

17-
$(P C and C++ programmers accustomed to explicitly managing memory
17+
$(P Programmers accustomed to explicitly managing memory
1818
allocation and
1919
deallocation will likely be skeptical of the benefits and efficacy of
2020
garbage collection. Experience both with new projects written with

spec/struct.dd

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $(HEADERNAV_TOC)
88
Any C struct can be exactly represented as a D struct, except non-static
99
$(RELATIVE_LINK2 nested, function-nested D structs) which access the context of
1010
their enclosing scope.
11-
Structs and unions are meant as simple aggregations of data, or as a way
11+
Structs and unions are simple aggregations of data, or as a way
1212
to paint a data structure over hardware or an external type. External
1313
types can be defined by the operating system API, or by a file format.
1414
Object oriented features are provided with the class data type.
@@ -18,70 +18,6 @@ $(HEADERNAV_TOC)
1818
the implementation is free to make bit copies of the struct
1919
as convenient.)
2020

21-
$(TABLE2 Struct$(COMMA) Class Comparison Table,
22-
$(THEAD Feature, $(D struct), $(D class), C $(D struct), C++
23-
$(D struct), C++ $(D class))
24-
25-
$(TROW value type, $(CHECK), $(UNCHECK), $(CHECK), $(CHECK), $(CHECK))
26-
$(TROW reference type, $(UNCHECK), $(CHECK), $(UNCHECK),
27-
$(UNCHECK), $(UNCHECK))
28-
$(TROW data members, $(CHECK), $(CHECK), $(CHECK), $(CHECK), $(CHECK))
29-
$(TROW hidden members, $(CHECK),
30-
$(CHECK), $(UNCHECK), $(CHECK), $(CHECK))
31-
$(TROW static members, $(CHECK), $(CHECK), $(UNCHECK),
32-
$(CHECK), $(CHECK))
33-
$(TROW $(RELATIVE_LINK2 static_struct_init, default member initializers),
34-
$(CHECK), $(CHECK), $(UNCHECK), $(UNCHECK), $(UNCHECK))
35-
$(TROW bit fields, $(UNCHECK), $(UNCHECK), $(CHECK), $(CHECK),
36-
$(CHECK))
37-
$(TROW non-virtual member functions, $(CHECK), $(CHECK),
38-
$(UNCHECK), $(CHECK), $(CHECK))
39-
$(TROW virtual member functions, $(UNCHECK), $(CHECK),
40-
$(UNCHECK), $(CHECK), $(CHECK))
41-
$(TROW $(RELATIVE_LINK2 struct-constructor, constructors), $(CHECK),
42-
$(CHECK), $(UNCHECK), $(CHECK), $(CHECK))
43-
$(TROW $(RELATIVE_LINK2 struct-postblit, postblit)/copy constructors,
44-
$(CHECK), $(UNCHECK), $(UNCHECK), $(CHECK), $(CHECK))
45-
$(TROW $(RELATIVE_LINK2 struct-destructor, destructors), $(CHECK),
46-
$(CHECK), $(UNCHECK), $(CHECK), $(CHECK))
47-
$(TROW $(GLINK2 class, SharedStaticConstructor)s, $(CHECK),
48-
$(CHECK), $(UNCHECK), $(UNCHECK), $(UNCHECK))
49-
$(TROW $(GLINK2 class, SharedStaticDestructor)s, $(CHECK),
50-
$(CHECK), $(UNCHECK), $(UNCHECK), $(UNCHECK))
51-
$(TROW RAII, $(CHECK), $(CHECK), $(UNCHECK), $(CHECK), $(CHECK))
52-
$(TROW $(RELATIVE_LINK2 assign-overload, identity assign overload), $(CHECK),
53-
$(UNCHECK), $(UNCHECK), $(CHECK), $(CHECK))
54-
$(TROW $(RELATIVE_LINK2 struct-literal, literals), $(CHECK), $(UNCHECK),
55-
$(UNCHECK), $(UNCHECK), $(UNCHECK))
56-
$(TROW operator overloading, $(CHECK), $(CHECK), $(UNCHECK),
57-
$(CHECK), $(CHECK))
58-
$(TROW inheritance, $(UNCHECK), $(CHECK), $(UNCHECK),
59-
$(CHECK), $(CHECK))
60-
$(TROW invariants, $(CHECK), $(CHECK), $(UNCHECK), $(UNCHECK),
61-
$(UNCHECK))
62-
$(TROW unit tests, $(CHECK), $(CHECK), $(UNCHECK), $(UNCHECK),
63-
$(UNCHECK))
64-
$(TROW synchronizable, $(UNCHECK), $(CHECK), $(UNCHECK), $(UNCHECK),
65-
$(UNCHECK))
66-
$(TROW parameterizable, $(CHECK), $(CHECK), $(UNCHECK),
67-
$(CHECK), $(CHECK))
68-
$(TROW alignment control, $(CHECK), $(CHECK), $(UNCHECK),
69-
$(UNCHECK), $(UNCHECK))
70-
$(TROW member protection, $(CHECK), $(CHECK), $(UNCHECK),$(CHECK),$(CHECK))
71-
$(TROW default public, $(CHECK), $(CHECK), $(CHECK),$(CHECK), $(UNCHECK))
72-
$(TROW tag name space, $(UNCHECK), $(UNCHECK), $(CHECK),
73-
$(CHECK), $(CHECK))
74-
$(TROW anonymous, $(CHECK), $(UNCHECK), $(CHECK), $(CHECK), $(CHECK))
75-
$(TROW static constructor, $(CHECK), $(CHECK), $(UNCHECK),
76-
$(UNCHECK), $(UNCHECK))
77-
$(TROW static destructor, $(CHECK), $(CHECK), $(UNCHECK),
78-
$(UNCHECK), $(UNCHECK))
79-
$(TROW const/immutable/shared, $(CHECK), $(CHECK), $(UNCHECK),
80-
$(UNCHECK), $(UNCHECK))
81-
$(TROW inner nesting, $(RELATIVE_LINK2 nested, $(CHECK)),
82-
$(DDSUBLINK spec/class, nested, $(CHECK)), $(UNCHECK), $(UNCHECK), $(UNCHECK))
83-
)
84-
8521
$(GRAMMAR
8622
$(GNAME AggregateDeclaration):
8723
$(GLINK2 class, ClassDeclaration)

spec/template.dd

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ $(SPEC_S Templates,
44

55
$(HEADERNAV_TOC)
66

7-
$(BLOCKQUOTE_BY Richard Deyman,
8-
I think that I can safely say that nobody understands C++ template mechanics.)
9-
107
$(P Templates are D's approach to generic programming.
118
Templates are defined with a $(I TemplateDeclaration):
129
)
@@ -340,8 +337,6 @@ $(H3 $(LNAME2 parameters_specialization, Specialization))
340337

341338
$(P The template picked to instantiate is the one that is most specialized
342339
that fits the types of the $(I TemplateArgumentList).
343-
Determining which is more specialized is done in the same way as the
344-
C++ partial ordering rules.
345340
If the result is ambiguous, it is an error.
346341
)
347342

spec/version.dd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ $(HEADERNAV_TOC)
66

77
$(P $(I Conditional compilation) is the process of selecting which
88
code to compile and which code to not compile.
9-
(In C and C++, conditional compilation is done with the preprocessor
10-
directives $(CODE #if) / $(CODE #else) / $(CODE #endif).)
119
)
1210

1311
$(GRAMMAR

0 commit comments

Comments
 (0)