diff --git a/.htaccess b/.htaccess
index 1eab97db59..7a0eafc6d7 100644
--- a/.htaccess
+++ b/.htaccess
@@ -52,3 +52,6 @@ version|traits|errors|unittest|garbage|float|iasm|ddoc|interfaceToC|\
cpp_interface|objc_interface|portability|entity|memory-safe-d|abi|simd)\
(\.html)?$ \
spec/$1.html [R=301,L]
+
+# Error pages
+ErrorDocument 404 /404.html
diff --git a/404.dd b/404.dd
new file mode 100644
index 0000000000..38a415eb34
--- /dev/null
+++ b/404.dd
@@ -0,0 +1,12 @@
+Ddoc
+
+$(D_S 404 Not Found,
+
+$(P
+Page not found!
+
+If you think there should be something here, please use the "Report a bug" link above to let us know.
+))
+
+Macros:
+ TITLE=404 Not Found
diff --git a/cpptod.dd b/cpptod.dd
index 526016b0be..83efe76167 100644
--- a/cpptod.dd
+++ b/cpptod.dd
@@ -2,7 +2,7 @@ Ddoc
$(COMMUNITY Programming in D for C++ Programmers,
-
+$(COMMENT img src="images/cpp1.gif" border="0" align="right" alt="C++")
$(P Every experienced C++ programmer accumulates a series of idioms and techniques
which become second nature. Sometimes, when learning a new language, those
@@ -28,7 +28,7 @@ $(UL
)
-
+$(COMMENT -------------------------------------------- )
$(H3 Defining constructors)
@@ -56,7 +56,7 @@ class Foo
which reflects how they are used in D.
-
+$(COMMENT -------------------------------------------- )
$(H3 Base class initialization)
$(H4 The C++ Way)
@@ -125,7 +125,7 @@ class A
}
------
-
+$(COMMENT -------------------------------------------- )
$(H3 Comparing structs)
$(H4 The C++ Way)
@@ -188,7 +188,7 @@ if (x == y)
...
------
-
+$(COMMENT -------------------------------------------- )
$(H3 Creating a new typedef'd type)
$(H4 The C++ Way)
@@ -255,7 +255,7 @@ if (h != Handle.init)
default initializer can be supplied to $(REF Typedef, std,typecons)
as a value of the underlying type.
-
+$(COMMENT -------------------------------------------- )
$(H3 Friends)
$(H4 The C++ Way)
@@ -326,7 +326,7 @@ int abc(A p) { return p.a; }
The $(D private) attribute prevents other modules from
accessing the members.
-
+$(COMMENT -------------------------------------------- )
$(H3 Operator overloading)
$(H4 The C++ Way)
@@ -375,7 +375,7 @@ struct A
error prone. Far less code needs to be written to accomplish
the same effect.)
-
+$(COMMENT -------------------------------------------- )
$(H3 Namespace using declarations)
$(H4 The C++ Way)
@@ -410,7 +410,7 @@ alias x = foo.x;
declaration. Alias can be used to rename symbols, refer to
template members, refer to nested class types, etc.
-
+$(COMMENT -------------------------------------------- )
$(H3 RAII (Resource Acquisition Is Initialization))
$(H4 The C++ Way)
@@ -475,7 +475,7 @@ mechanism that lets you run arbitrary statements whenever leaving the current
scope.)
-
+$(COMMENT -------------------------------------------- )
$(H3 Properties)
$(H4 The C++ Way)
@@ -542,7 +542,7 @@ int x = a.property;
It's also a way to have interface classes, which do not have
data fields, behave syntactically as if they did.
-
+$(COMMENT -------------------------------------------- )
$(H3 Recursive Templates)
$(H4 The C++ Way)
@@ -593,7 +593,7 @@ void test()
}
------
-
+$(COMMENT -------------------------------------------- )
$(H3 Meta Templates)
@@ -745,7 +745,7 @@ int main()
}
------
-
+$(COMMENT -------------------------------------------- )
$(H3 Type Traits)
diff --git a/css/style.css b/css/style.css
index a9c4c0b8d8..183b28c034 100644
--- a/css/style.css
+++ b/css/style.css
@@ -1217,6 +1217,16 @@ These classes come from prettify.js:
.cm-s-eclipse span.cm-link {color: #219;}
+.ddoc_keyword
+{
+ font-weight: bold;
+}
+
+.ddoc_param
+{
+ font-style: italic;
+}
+
/* Focal symbol that is being documented */
.d_psymbol, .ddoc_psymbol
{
@@ -2103,3 +2113,8 @@ dt.d_decl:hover .decl_anchor {
text-decoration: none;
color: #333;
}
+
+/* Style for the example run buttons on the Phobos library documentation */
+.d_example_buttons {
+ text-align: right;
+}
diff --git a/ctod.dd b/ctod.dd
index b9969cb06c..d40703191b 100644
--- a/ctod.dd
+++ b/ctod.dd
@@ -6,7 +6,7 @@ $(COMMENT $(BLOCKQUOTE_BY William Nerdspeare,
Et tu, D? Then fall, C!
))
-
+$(COMMENT img src="images/c1.gif" border="0" align="right" alt="ouch!")
$(P Every experienced C programmer accumulates a series of idioms and techniques
which become second nature. Sometimes, when learning a new language, those
@@ -64,7 +64,7 @@ $(UL
$(LI $(RELATIVE_LINK2 variadic, Variadic Function Parameters))
)
-
+$(COMMENT -------------------------------------------- )
$(H3 Getting the Size of a Type)
$(H4 The C Way)
@@ -87,7 +87,7 @@ double.sizeof
Foo.sizeof
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Get the max and min values of a type)
$(H4 The C Way)
@@ -111,7 +111,7 @@ ulong.max
double.min
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Primitive Types)
$(H4 C to D types)
@@ -143,7 +143,7 @@ $(P
)
$(P Ints and unsigneds in C are of varying size; not so in D.)
-
+$(COMMENT ============================================ )
$(H3 Special Floating Point Values)
$(H4 The C Way)
@@ -179,7 +179,7 @@ double.min_10_exp
double.min_exp
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Remainder after division of floating point numbers)
$(H4 The C Way)
@@ -202,7 +202,7 @@ double d = x % y;
real r = x % y;
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Dealing with NANs in floating point compares)
$(H4 The C Way)
@@ -229,7 +229,7 @@ $(H4 The D Way)
result = (x < y); // false if x or y is nan
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Asserts are a necessary part of any good defensive coding strategy)
$(H4 The C Way)
@@ -251,7 +251,7 @@ D simply builds assert into the language:
assert(e == 0);
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Initializing all elements of an array)
$(H4 The C Way)
@@ -270,7 +270,7 @@ int[17] array;
array[] = value;
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Looping through an array)
$(H4 The C Way)
@@ -327,7 +327,7 @@ foreach (ref value; array)
value += 42;
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Creating an array of variable size)
$(H4 The C Way)
@@ -363,7 +363,7 @@ array.length = array.length + 1;
array[array.length - 1] = x;
----------------------------
-
+$(COMMENT ============================================ )
$(H3 String Concatenation)
$(H4 The C Way)
@@ -418,7 +418,7 @@ s = s1 ~ s2;
s ~= "hello";
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Formatted printing)
$(H4 The C Way)
@@ -447,7 +447,7 @@ import std.stdio;
writefln("Calling all cars %s times!", ntimes);
-----------------------
-
+$(COMMENT ============================================ )
$(H3 Forward referencing functions)
$(H4 The C Way)
@@ -490,7 +490,7 @@ void forwardfunc()
}
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Functions that have no arguments)
$(H4 The C Way)
@@ -502,7 +502,7 @@ void foo(void);
$(H4 The D Way)
D is a strongly typed language, so there is no need to explicitly
- say a function takes no arguments, just don't declare it has having
+ say a function takes no arguments, just don't declare it as having
arguments.
----------------------------
@@ -512,7 +512,7 @@ void foo()
}
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Labeled break and continue statements)
$(H4 The C Way)
@@ -559,7 +559,7 @@ Louter:
// break Louter goes here
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Goto Statements)
$(H4 The C Way)
@@ -577,7 +577,7 @@ $(H4 The D Way)
programmers who know when the rules need to be broken. So of course D
supports goto statements.
-
+$(COMMENT ============================================ )
$(H3 Struct tag name space)
$(H4 The C Way)
@@ -598,7 +598,7 @@ $(H4 The D Way)
struct ABC { ... }
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Looking up strings)
$(H4 The C Way)
@@ -665,7 +665,7 @@ void dostring(char[] s)
to generate a fast lookup scheme for it, eliminating the bugs
and time required in hand-coding one.
-
+$(COMMENT ============================================ )
$(H3 Setting struct member alignment)
$(H4 The C Way)
@@ -711,7 +711,7 @@ struct ABC
}
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Anonymous Structs and Unions)
Sometimes, it's nice to control the layout of a struct with nested structs and unions.
@@ -771,7 +771,7 @@ f.y;
f.p;
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Declaring struct types and variables)
$(H4 The C Way)
@@ -805,7 +805,7 @@ Foo foo;
block {} in how semicolons are used.
)
-
+$(COMMENT ============================================ )
$(H3 Getting the offset of a struct member)
$(H4 The C Way)
@@ -829,7 +829,7 @@ struct Foo { int x; int y; }
off = Foo.y.offsetof;
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Union Initializations)
$(H4 The C Way)
@@ -855,7 +855,7 @@ U x = { a:5 };
avoiding the confusion and maintenance problems.
-
+$(COMMENT ============================================ )
$(H3 Struct Initializations)
$(H4 The C Way)
@@ -884,7 +884,7 @@ S x = { b:3, a:5 };
The meaning is clear, and there no longer is a positional dependence.
-
+$(COMMENT ============================================ )
$(H3 Array Initializations)
$(H4 The C Way)
@@ -927,7 +927,7 @@ int[2][3] b = [ [2,3], [6,5], [3,4] ];
int[2][3] b = [[2,6,3],[3,5,4]]; // error
----------------------------
-
+$(COMMENT ============================================ )
$(H3 Escaped String Literals)
$(H4 The C Way)
@@ -962,7 +962,7 @@ string quotedString = `"[^\\]*(\\.[^\\]*)*"`; // "[^\\]*(\\.[^\\]*)*"
string hello = "hello world\n";
----------------------------
-
+$(COMMENT ============================================ )
$(H3 ASCII versus Wide Characters)
$(P Modern programming requires that wchar strings be supported in an easy way, for internationalization of the programs.)
@@ -995,7 +995,7 @@ auto _utf16 = "hello"w; // UTF-16 string
auto _utf32 = "hello"d; // UTF-32 string
-----------------------------
-
+$(COMMENT ============================================ )
$(H3 Arrays that parallel an enum)
$(H4 The C Way)
@@ -1021,7 +1021,7 @@ string[COLORS.max + 1] cstring =
Not perfect, but better.
-
+$(COMMENT ============================================ )
$(H3 Creating a new type with typedef)
$(H4 The C Way)
@@ -1117,7 +1117,7 @@ if (h != Handle.init)
There's only one name to remember: $(D Handle).
-
+$(COMMENT ============================================ )
$(H3 Comparing structs)
$(H4 The C Way)
@@ -1163,7 +1163,7 @@ if (x == y)
-----------------------------
-
+$(COMMENT ============================================ )
$(H3 Comparing strings)
$(H4 The C Way)
@@ -1206,7 +1206,7 @@ if (str < "betty")
which is useful for sorting/searching.
-
+$(COMMENT ============================================ )
$(H3 Sorting arrays)
$(H4 The C Way)
@@ -1246,7 +1246,7 @@ type[] array;
sort(array); // sort array in-place
-----------------------------
-
+$(COMMENT ============================================ )
$(H3 String literals)
$(H4 The C Way)
@@ -1276,7 +1276,7 @@ lines
So blocks of text can just be cut and pasted into the D
source.
-
+$(COMMENT ============================================ )
$(H3 Data Structure Traversal)
$(H4 The C Way)
@@ -1389,7 +1389,7 @@ Symbol symbol_membersearch(Symbol[] table, char[] id)
}
-----------------------------
-
+$(COMMENT ============================================ )
$(H3 Unsigned Right Shift)
$(H4 The C Way)
@@ -1437,7 +1437,7 @@ j = i >>> 3;
avoids the unsafe cast and will work as expected with any integral
type.
-
+$(COMMENT ============================================ )
$(H3 Dynamic Closures)
$(H4 The C Way)
@@ -1531,7 +1531,7 @@ void func(Collection c)
eliminating the need to create irrelevant function names.
-
+$(COMMENT ============================================ )
$(H3 Variadic Function Parameters)
The task is to write a function that takes a varying
diff --git a/dcompiler.dd b/dcompiler.dd
index 97d6bfc365..2d97fb22e7 100644
--- a/dcompiler.dd
+++ b/dcompiler.dd
@@ -649,6 +649,33 @@ dmd -cov -unittest myprog.d
generate a $(TT .map) file
)
+ $(SWITCH $(SWNAME -mcpu)=[$(B ?)|$(B baseline)|$(B avx)|$(B native)],
+ Set the target architecture for code generation,
+ where:
+ $(DL
+ $(DT ?)$(DD list alternatives)
+ $(DT baseline)$(DD the minimum architecture for the target platform (default))
+ $(DT avx)$(DD
+ generate $(LINK2 https://en.wikipedia.org/wiki/Advanced_Vector_Extensions, AVX)
+ instructions instead of $(LINK2 https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions, SSE)
+ instructions for vector and floating point operations.
+ Not available for 32 bit memory models other than OSX32.
+ )
+ $(DT native)$(DD use the architecture the compiler is running on)
+ )
+ )
+
+ $(WINDOWS
+ $(SWITCH $(SWNAME -mscrt)=$(I libname),
+ if building MS-COFF object files with -m64 or -m32mscoff, embed a reference to
+ the given C runtime library $(I libname) into the object file containing `main`,
+ `DllMain` or `WinMain` for automatic linking. The default is $(TT libcmt)
+ (release version with static linkage), the other usual alternatives are
+ $(TT libcmtd), $(TT msvcrt) and $(TT msvcrtd).
+ If $(I libname) is empty, no C runtime library is automatically linked in.
+ )
+ )
+
$(SWITCH $(SWNAME -noboundscheck),
turns off all array bounds checking, even for safe functions. $(RED Deprecated
(use $(TT $(SWLINK -boundscheck)=off) instead).)
@@ -1176,4 +1203,4 @@ Macros:
DMC=$(LINK2 http://www.digitalmars.com/ctg/sc.html, dmc)
LIB=$(LINK2 http://www.digitalmars.com/ctg/lib.html, lib)
OPTLINK=$(LINK2 http://www.digitalmars.com/ctg/optlink.html, link.exe)
- SUBNAV=$(SUBNAV_CLI_REFERENCE)
+ SUBNAV=$(SUBNAV_CLI_REFERENCE)
diff --git a/deprecate.dd b/deprecate.dd
index 26efc0d574..784871a84d 100644
--- a/deprecate.dd
+++ b/deprecate.dd
@@ -10,7 +10,8 @@ $(SPEC_S Deprecated Features,
$(TABLE2 Deprecated Features,
$(THEAD Feature, Spec, Dep, Error, Gone)
- $(TROW $(DEPLINK Using the result of a comma expression), future, , , )
+ $(TROW $(DEPLINK Implicit string concatenation), 2.072, 2.072, , )
+ $(TROW $(DEPLINK Using the result of a comma expression), 2.072, 2.072, , )
$(TROW $(DEPLINK delete), future, , , )
$(TROW $(DEPLINK scope for allocating classes on the stack), future, , , )
$(TROW $(DEPLINK Imaginary and complex types), future, , , )
@@ -57,6 +58,42 @@ $(SPEC_S Deprecated Features,
)
+$(H3 $(DEPNAME Implicit string concatenation))
+ $(P Currently, two adjacent strings are implicitly concatenated:
+
+ ---
+ string foo = "Hello" "World";
+ ---
+
+ This feature is handy for a long string that spans multiple lines,
+ however it is possible to get the same behaviour explicitly by
+ using the concatenation operator ('~'):
+
+ ---
+ string foo = "Hello" ~ "World"; // No allocation is performed
+ ---
+ )
+$(H4 Corrective Action)
+ $(P Replace implicit string concatenation by explicit one, using '~'.)
+$(H4 Rationale)
+ $(P This is a very early feature of the language, which is nowadays totally
+ covered by the concatenation operator: it is performed at compile time
+ for constants and doesn't result in memory allocation.)
+
+ $(P However, having implicit concatenation can and did result in hard
+ to spot bugs, for example:)
+
+ ---
+ string[] names =
+ [
+ "Anna",
+ "Michael"
+ "Emma",
+ "David"
+ ];
+ // The content of arr is [ "Anna", "MichaelEmma", "David" ]
+ ---
+
$(H3 $(DEPNAME Using the result of a comma expression))
$(P The comma operator (`,`) allows executing multiple expressions and
discards the result of them except for the last which is returned.
diff --git a/dlang.org.ddoc b/dlang.org.ddoc
index 6be8fee5f3..ee19198ab6 100644
--- a/dlang.org.ddoc
+++ b/dlang.org.ddoc
@@ -93,6 +93,7 @@ $(DIVC container,
)
)
$(COMMON_SCRIPTS)
+$(EXTRA_FOOTERS)
$(LAYOUT_SUFFIX)