diff --git a/etc/c/odbc/sql.d b/etc/c/odbc/sql.d index 0ac2684c117..4614ea1b4b6 100644 --- a/etc/c/odbc/sql.d +++ b/etc/c/odbc/sql.d @@ -15,7 +15,7 @@ typically not a part of the distribution packages of other compilers such as `gdc` and `ldc`). To use ODBC, install it per the vendor- and platform-specific instructions and then use the appropriate command-line flags (e.g. for dmd, `-L-lodbc` on Posix and `-Lodbc32.lib` on Windows) to link -with the ODBC library. On Windows, using $(D pragma(lib, "odbc32")) in D +with the ODBC library. On Windows, using `pragma(lib, "odbc32")` in D code at top level is also appropriate. See_Also: $(LUCKY ODBC API Reference on MSN Online) diff --git a/posix.mak b/posix.mak index 7c1ac40a8aa..aed2ccc9b7d 100644 --- a/posix.mak +++ b/posix.mak @@ -525,6 +525,9 @@ style: ../dscanner/dsc @echo "Enforce space between binary operators" grep -nrE "[[:alnum:]](==|!=|<=|<<|>>|>>>|^^)[[:alnum:]]|[[:alnum:]] (==|!=|<=|<<|>>|>>>|^^)[[:alnum:]]|[[:alnum:]](==|!=|<=|<<|>>|>>>|^^) [[:alnum:]]" $$(find . -name '*.d'); test $$? -eq 1 + @echo "Check for uses of the old ddoc code macro (only two or more words)" + grep -nrE '[$$]\(D [^)]{1,} [^)]{1,}\)' $$(find . -name '*.d') ; test $$? -eq 1 + # at the moment libdparse has problems to parse some modules (->excludes) @echo "Running DScanner" ../dscanner/dsc --config .dscanner.ini --styleCheck $$(find etc std -type f -name '*.d' | grep -vE 'std/traits.d|std/typecons.d') -I. diff --git a/std/algorithm/comparison.d b/std/algorithm/comparison.d index 59edb82cbd2..d8bdb0032cf 100644 --- a/std/algorithm/comparison.d +++ b/std/algorithm/comparison.d @@ -7,39 +7,39 @@ $(BOOKTABLE Cheat Sheet, $(TR $(TH Function Name) $(TH Description)) $(T2 among, Checks if a value is among a set of values, e.g. - $(D if (v.among(1, 2, 3)) // `v` is 1, 2 or 3)) + `if (v.among(1, 2, 3)) // `v` is 1, 2 or 3`) $(T2 castSwitch, - $(D (new A()).castSwitch((A a)=>1,(B b)=>2)) returns $(D 1).) + `(new A()).castSwitch((A a)=>1,(B b)=>2)` returns `1`.) $(T2 clamp, - $(D clamp(1, 3, 6)) returns $(D 3). $(D clamp(4, 3, 6)) returns $(D 4).) + `clamp(1, 3, 6)` returns `3`. `clamp(4, 3, 6)` returns `4`.) $(T2 cmp, - $(D cmp("abc", "abcd")) is $(D -1), $(D cmp("abc", "aba")) is $(D 1), - and $(D cmp("abc", "abc")) is $(D 0).) + `cmp("abc", "abcd")` is `-1`, `cmp("abc", "aba")` is `1`, + and `cmp("abc", "abc")` is `0`.) $(T2 either, - Return first parameter $(D p) that passes an $(D if (p)) test, e.g. - $(D either(0, 42, 43)) returns $(D 42).) + Return first parameter `p` that passes an `if (p)` test, e.g. + `either(0, 42, 43)` returns `42`.) $(T2 equal, Compares ranges for element-by-element equality, e.g. - $(D equal([1, 2, 3], [1.0, 2.0, 3.0])) returns $(D true).) + `equal([1, 2, 3], [1.0, 2.0, 3.0])` returns `true`.) $(T2 isPermutation, - $(D isPermutation([1, 2], [2, 1])) returns $(D true).) + `isPermutation([1, 2], [2, 1])` returns `true`.) $(T2 isSameLength, - $(D isSameLength([1, 2, 3], [4, 5, 6])) returns $(D true).) + `isSameLength([1, 2, 3], [4, 5, 6])` returns `true`.) $(T2 levenshteinDistance, - $(D levenshteinDistance("kitten", "sitting")) returns $(D 3) by using + `levenshteinDistance("kitten", "sitting")` returns `3` by using the $(LUCKY Levenshtein distance _algorithm).) $(T2 levenshteinDistanceAndPath, - $(D levenshteinDistanceAndPath("kitten", "sitting")) returns - $(D tuple(3, "snnnsni")) by using the $(LUCKY Levenshtein distance + `levenshteinDistanceAndPath("kitten", "sitting")` returns + `tuple(3, "snnnsni")` by using the $(LUCKY Levenshtein distance _algorithm).) $(T2 max, - $(D max(3, 4, 2)) returns $(D 4).) + `max(3, 4, 2)` returns `4`.) $(T2 min, - $(D min(3, 4, 2)) returns $(D 2).) + `min(3, 4, 2)` returns `2`.) $(T2 mismatch, - $(D mismatch("oh hi", "ohayo")) returns $(D tuple(" hi", "ayo")).) + `mismatch("oh hi", "ohayo")` returns `tuple(" hi", "ayo")`.) $(T2 predSwitch, - $(D 2.predSwitch(1, "one", 2, "two", 3, "three")) returns $(D "two").) + `2.predSwitch(1, "one", 2, "two", 3, "three")` returns `"two"`.) ) Copyright: Andrei Alexandrescu 2008-. @@ -514,7 +514,7 @@ auto castSwitch(choices...)(Object switchObject) /** Clamps a value into the given bounds. -This functions is equivalent to $(D max(lower, min(upper,val))). +This functions is equivalent to `max(lower, min(upper,val))`. Params: val = The value to _clamp. @@ -736,7 +736,7 @@ template equal(alias pred = "a == b") /++ Compares two ranges for equality. The ranges may have - different element types, as long as $(D pred(r1.front, r2.front)) + different element types, as long as `pred(r1.front, r2.front)` evaluates to $(D bool). Performs $(BIGOH min(r1.length, r2.length)) evaluations of $(D pred). @@ -986,7 +986,7 @@ Encodes $(HTTP realityinteractive.com/rgrzywinski/archives/000249.html, edit operations) necessary to transform one sequence into another. Given sequences $(D s) (source) and $(D t) (target), a sequence of $(D EditOp) encodes the steps that need to be taken to -convert $(D s) into $(D t). For example, if $(D s = "cat") and $(D +convert `s` into `t`. For example, if `s = "cat"` and $(D "cars"), the minimal sequence that transforms $(D s) into $(D t) is: skip two characters, replace 't' with 'r', and insert an 's'. Working with edit operations is useful in applications such as spell-checkers diff --git a/std/algorithm/iteration.d b/std/algorithm/iteration.d index dd7b42f91f1..ddfc1908b9d 100644 --- a/std/algorithm/iteration.d +++ b/std/algorithm/iteration.d @@ -12,37 +12,37 @@ $(T2 cacheBidirectional, $(T2 chunkBy, $(D chunkBy!((a,b) => a[1] == b[1])([[1, 1], [1, 2], [2, 2], [2, 1]])) returns a range containing 3 subranges: the first with just - $(D [1, 1]); the second with the elements $(D [1, 2]) and $(D [2, 2]); - and the third with just $(D [2, 1]).) + `[1, 1]`; the second with the elements `[1, 2]` and `[2, 2]`; + and the third with just `[2, 1]`.) $(T2 cumulativeFold, - $(D cumulativeFold!((a, b) => a + b)([1, 2, 3, 4])) returns a + `cumulativeFold!((a, b) => a + b)([1, 2, 3, 4])` returns a lazily-evaluated range containing the successive reduced values `1`, `3`, `6`, `10`.) $(T2 each, - $(D each!writeln([1, 2, 3])) eagerly prints the numbers $(D 1), $(D 2) + `each!writeln([1, 2, 3])` eagerly prints the numbers `1`, `2` and $(D 3) on their own lines.) $(T2 filter, - $(D filter!(a => a > 0)([1, -1, 2, 0, -3])) iterates over elements $(D 1) + `filter!(a => a > 0)([1, -1, 2, 0, -3])` iterates over elements `1` and $(D 2).) $(T2 filterBidirectional, Similar to $(D filter), but also provides $(D back) and $(D popBack) at a small increase in cost.) $(T2 fold, - $(D fold!((a, b) => a + b)([1, 2, 3, 4])) returns $(D 10).) + `fold!((a, b) => a + b)([1, 2, 3, 4])` returns `10`.) $(T2 group, - $(D group([5, 2, 2, 3, 3])) returns a range containing the tuples - $(D tuple(5, 1)), $(D tuple(2, 2)), and $(D tuple(3, 2)).) + `group([5, 2, 2, 3, 3])` returns a range containing the tuples + `tuple(5, 1)`, `tuple(2, 2)`, and `tuple(3, 2)`.) $(T2 joiner, - $(D joiner(["hello", "world!"], "; ")) returns a range that iterates - over the characters $(D "hello; world!"). No new string is created - + `joiner(["hello", "world!"], "; ")` returns a range that iterates + over the characters `"hello; world!"`. No new string is created - the existing inputs are iterated.) $(T2 map, - $(D map!(a => a * 2)([1, 2, 3])) lazily returns a range with the numbers + `map!(a => a * 2)([1, 2, 3])` lazily returns a range with the numbers $(D 2), $(D 4), $(D 6).) $(T2 permutations, Lazily computes all permutations using Heap's algorithm.) $(T2 reduce, - $(D reduce!((a, b) => a + b)([1, 2, 3, 4])) returns $(D 10). + `reduce!((a, b) => a + b)([1, 2, 3, 4])` returns `10`. This is the old implementation of `fold`.) $(T2 splitter, Lazily splits a range by a separator.) @@ -435,7 +435,7 @@ private struct _Cache(R, bool bidir) } /** -$(D auto map(Range)(Range r) if (isInputRange!(Unqual!Range));) +`auto map(Range)(Range r) if (isInputRange!(Unqual!Range));` Implements the homonym function (also known as $(D transform)) present in many languages of functional flavor. The call $(D map!(fun)(range)) @@ -1069,7 +1069,7 @@ template each(alias pred = "a") } /** -$(D auto filter(Range)(Range rs) if (isInputRange!(Unqual!Range));) +`auto filter(Range)(Range rs) if (isInputRange!(Unqual!Range));` Implements the higher order _filter function. The predicate is passed to $(REF unaryFun, std,functional), and can either accept a string, or any callable @@ -1272,7 +1272,7 @@ private struct FilterResult(alias pred, Range) } /** - * $(D auto filterBidirectional(Range)(Range r) if (isBidirectionalRange!(Unqual!Range));) + * `auto filterBidirectional(Range)(Range r) if (isBidirectionalRange!(Unqual!Range));` * * Similar to $(D filter), except it defines a bidirectional * range. There is a speed disadvantage - the constructor spends time @@ -1374,16 +1374,16 @@ Similarly to $(D uniq), $(D group) produces a range that iterates over unique consecutive elements of the given range. Each element of this range is a tuple of the element and the number of times it is repeated in the original range. Equivalence of elements is assessed by using the predicate $(D pred), which -defaults to $(D "a == b"). The predicate is passed to $(REF binaryFun, std,functional), +defaults to `"a == b"`. The predicate is passed to $(REF binaryFun, std,functional), and can either accept a string, or any callable that can be executed via -$(D pred(element, element)). +`pred(element, element)`. Params: pred = Binary predicate for determining equivalence of two elements. r = The $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to iterate over. -Returns: A range of elements of type $(D Tuple!(ElementType!R, uint)), +Returns: A range of elements of type `Tuple!(ElementType!R, uint)`, representing each consecutively unique element and its respective number of occurrences in that run. This will be an input range if $(D R) is an input range, and a forward range in all other cases. @@ -2702,7 +2702,7 @@ languages of functional flavor. There is also $(LREF fold) which does the same thing but with the opposite parameter order. The call $(D reduce!(fun)(seed, range)) first assigns $(D seed) to an internal variable $(D result), also called the accumulator. -Then, for each element $(D x) in $(D range), $(D result = fun(result, x)) +Then, for each element `x` in `range`, `result = fun(result, x)` gets evaluated. Finally, $(D result) is returned. The one-argument version $(D reduce!(fun)(range)) works similarly, but it uses the first element of the range as the @@ -2718,7 +2718,7 @@ See_Also: and without the need to use $(LREF tuple) for multiple seeds. This makes it easier to use in UFCS chains. - $(LREF sum) is similar to $(D reduce!((a, b) => a + b)) that offers + $(LREF sum) is similar to `reduce!((a, b) => a + b)` that offers pairwise summing of floating point numbers. +/ template reduce(fun...) @@ -2734,11 +2734,11 @@ if (fun.length >= 1) No-seed version. The first element of $(D r) is used as the seed's value. For each function $(D f) in $(D fun), the corresponding - seed type $(D S) is $(D Unqual!(typeof(f(e, e)))), where $(D e) is an + seed type `S` is `Unqual!(typeof(f(e, e)))`, where `e` is an element of $(D r): $(D ElementType!R) for ranges, and $(D ForeachType!R) otherwise. - Once S has been determined, then $(D S s = e;) and $(D s = f(s, e);) + Once S has been determined, then `S s = e;` and `s = f(s, e);` must both be legal. If $(D r) is empty, an $(D Exception) is thrown. @@ -3156,7 +3156,7 @@ compress), $(D inject), or $(D foldl)) present in various programming languages of functional flavor. The call $(D fold!(fun)(range, seed)) first assigns $(D seed) to an internal variable $(D result), also called the accumulator. Then, for each element $(D x) in $(D -range), $(D result = fun(result, x)) gets evaluated. Finally, $(D +range), `result = fun(result, x)` gets evaluated. Finally, $(D result) is returned. The one-argument version $(D fold!(fun)(range)) works similarly, but it uses the first element of the range as the seed (the range must be non-empty). @@ -3167,7 +3167,7 @@ Returns: See_Also: $(HTTP en.wikipedia.org/wiki/Fold_(higher-order_function), Fold (higher-order function)) - $(LREF sum) is similar to $(D fold!((a, b) => a + b)) that offers + $(LREF sum) is similar to `fold!((a, b) => a + b)` that offers precise summing of floating point numbers. This is functionally equivalent to $(LREF reduce) with the argument order reversed, @@ -3227,7 +3227,7 @@ if (fun.length >= 1) Similar to `fold`, but returns a range containing the successive reduced values. The call $(D cumulativeFold!(fun)(range, seed)) first assigns `seed` to an internal variable `result`, also called the accumulator. -The returned range contains the values $(D result = fun(result, x)) lazily +The returned range contains the values `result = fun(result, x)` lazily evaluated for each element `x` in `range`. Finally, the last element has the same value as $(D fold!(fun)(seed, range)). The one-argument version $(D cumulativeFold!(fun)(range)) works similarly, but @@ -3255,9 +3255,9 @@ if (fun.length >= 1) /++ No-seed version. The first element of `r` is used as the seed's value. For each function `f` in `fun`, the corresponding seed type `S` is - $(D Unqual!(typeof(f(e, e)))), where `e` is an element of `r`: + `Unqual!(typeof(f(e, e)))`, where `e` is an element of `r`: `ElementType!R`. - Once `S` has been determined, then $(D S s = e;) and $(D s = f(s, e);) must + Once `S` has been determined, then `S s = e;` and `s = f(s, e);` must both be legal. Params: range = an input range as defined by `isInputRange` @@ -3611,11 +3611,11 @@ any narrow string type or sliceable range type, but is most popular with string types. Two adjacent separators are considered to surround an empty element in -the split range. Use $(D filter!(a => !a.empty)) on the result to compress +the split range. Use `filter!(a => !a.empty)` on the result to compress empty elements. The predicate is passed to $(REF binaryFun, std,functional), and can either accept -a string, or any callable that can be executed via $(D pred(element, s)). +a string, or any callable that can be executed via `pred(element, s)`. If the empty range is given, the result is a range with one empty element. If a range with one separator is given, the result is a range @@ -3627,7 +3627,7 @@ below). Params: pred = The predicate for comparing each element with the separator, - defaulting to $(D "a == b"). + defaulting to `"a == b"`. r = The $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to be split. Must support slicing and $(D .length). s = The element to be treated as the separator between range segments to be @@ -3903,15 +3903,15 @@ Similar to the previous overload of $(D splitter), except this one uses another range as a separator. This can be used with any narrow string type or sliceable range type, but is most popular with string types. The predicate is passed to $(REF binaryFun, std,functional), and can either accept a string, or any callable -that can be executed via $(D pred(r.front, s.front)). +that can be executed via `pred(r.front, s.front)`. Two adjacent separators are considered to surround an empty element in -the split range. Use $(D filter!(a => !a.empty)) on the result to compress +the split range. Use `filter!(a => !a.empty)` on the result to compress empty elements. Params: pred = The predicate for comparing each element with the separator, - defaulting to $(D "a == b"). + defaulting to `"a == b"`. r = The $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to be split. s = The $(REF_ALTTEXT forward range, isForwardRange, std,range,primitives) to @@ -4175,10 +4175,10 @@ if (is(typeof(binaryFun!pred(r.front, s.front)) : bool) Similar to the previous overload of $(D splitter), except this one does not use a separator. Instead, the predicate is an unary function on the input range's element type. The $(D isTerminator) predicate is passed to $(REF unaryFun, std,functional) and can -either accept a string, or any callable that can be executed via $(D pred(element, s)). +either accept a string, or any callable that can be executed via `pred(element, s)`. Two adjacent separators are considered to surround an empty element in -the split range. Use $(D filter!(a => !a.empty)) on the result to compress +the split range. Use `filter!(a => !a.empty)` on the result to compress empty elements. Params: @@ -4628,7 +4628,7 @@ b)(r, 0), $(D sum) uses specialized algorithms to maximize accuracy, as follows. $(UL -$(LI If $(D $(REF ElementType, std,range,primitives)!R) is a floating-point +$(LI If `$(REF ElementType, std,range,primitives)!R` is a floating-point type and $(D R) is a $(REF_ALTTEXT random-access range, isRandomAccessRange, std,range,primitives) with length and slicing, then $(D sum) uses the @@ -4657,7 +4657,7 @@ and precision used for summation. Note that these specialized summing algorithms execute more primitive operations than vanilla summation. Therefore, if in certain cases maximum speed is required -at expense of precision, one can use $(D fold!((a, b) => a + b)(r, 0)), which +at expense of precision, one can use `fold!((a, b) => a + b)(r, 0)`, which is not specialized for summation. Params: @@ -4917,9 +4917,9 @@ private auto sumKahan(Result, R)(Result result, R r) Lazily iterates unique consecutive elements of the given range (functionality akin to the $(HTTP wikipedia.org/wiki/_Uniq, _uniq) system utility). Equivalence of elements is assessed by using the predicate -$(D pred), by default $(D "a == b"). The predicate is passed to +`pred`, by default `"a == b"`. The predicate is passed to $(REF binaryFun, std,functional), and can either accept a string, or any callable -that can be executed via $(D pred(element, element)). If the given range is +that can be executed via `pred(element, element)`. If the given range is bidirectional, $(D uniq) also yields a bidirectional range. Params: diff --git a/std/algorithm/mutation.d b/std/algorithm/mutation.d index 95d406b3402..8e6703f9c4e 100644 --- a/std/algorithm/mutation.d +++ b/std/algorithm/mutation.d @@ -6,23 +6,23 @@ It contains generic _mutation algorithms. $(BOOKTABLE Cheat Sheet, $(TR $(TH Function Name) $(TH Description)) $(T2 bringToFront, - If $(D a = [1, 2, 3]) and $(D b = [4, 5, 6, 7]), - $(D bringToFront(a, b)) leaves $(D a = [4, 5, 6]) and - $(D b = [7, 1, 2, 3]).) + If `a = [1, 2, 3]` and `b = [4, 5, 6, 7]`, + `bringToFront(a, b)` leaves `a = [4, 5, 6]` and + `b = [7, 1, 2, 3]`.) $(T2 copy, Copies a range to another. If - $(D a = [1, 2, 3]) and $(D b = new int[5]), then $(D copy(a, b)) - leaves $(D b = [1, 2, 3, 0, 0]) and returns $(D b[3 .. $]).) + `a = [1, 2, 3]` and `b = new int[5]`, then `copy(a, b)` + leaves `b = [1, 2, 3, 0, 0]` and returns `b[3 .. $]`.) $(T2 fill, Fills a range with a pattern, - e.g., if $(D a = new int[3]), then $(D fill(a, 4)) - leaves $(D a = [4, 4, 4]) and $(D fill(a, [3, 4])) leaves - $(D a = [3, 4, 3]).) + e.g., if `a = new int[3]`, then `fill(a, 4)` + leaves `a = [4, 4, 4]` and `fill(a, [3, 4])` leaves + `a = [3, 4, 3]`.) $(T2 initializeAll, - If $(D a = [1.2, 3.4]), then $(D initializeAll(a)) leaves - $(D a = [double.init, double.init]).) + If `a = [1.2, 3.4]`, then `initializeAll(a)` leaves + `a = [double.init, double.init]`.) $(T2 move, - $(D move(a, b)) moves $(D a) into $(D b). $(D move(a)) reads $(D a) + `move(a, b)` moves `a` into `b`. `move(a)` reads `a` destructively when necessary.) $(T2 moveAll, Moves all elements from one range to another.) @@ -32,21 +32,21 @@ $(T2 remove, Removes elements from a range in-place, and returns the shortened range.) $(T2 reverse, - If $(D a = [1, 2, 3]), $(D reverse(a)) changes it to $(D [3, 2, 1]).) + If `a = [1, 2, 3]`, `reverse(a)` changes it to `[3, 2, 1]`.) $(T2 strip, Strips all leading and trailing elements equal to a value, or that satisfy a predicate. - If $(D a = [1, 1, 0, 1, 1]), then $(D strip(a, 1)) and - $(D strip!(e => e == 1)(a)) returns $(D [0]).) + If `a = [1, 1, 0, 1, 1]`, then `strip(a, 1)` and + `strip!(e => e == 1)(a)` returns `[0]`.) $(T2 stripLeft, Strips all leading elements equal to a value, or that satisfy a - predicate. If $(D a = [1, 1, 0, 1, 1]), then $(D stripLeft(a, 1)) and - $(D stripLeft!(e => e == 1)(a)) returns $(D [0, 1, 1]).) + predicate. If `a = [1, 1, 0, 1, 1]`, then `stripLeft(a, 1)` and + `stripLeft!(e => e == 1)(a)` returns `[0, 1, 1]`.) $(T2 stripRight, Strips all trailing elements equal to a value, or that satisfy a predicate. - If $(D a = [1, 1, 0, 1, 1]), then $(D stripRight(a, 1)) and - $(D stripRight!(e => e == 1)(a)) returns $(D [1, 1, 0]).) + If `a = [1, 1, 0, 1, 1]`, then `stripRight(a, 1)` and + `stripRight!(e => e == 1)(a)` returns `[1, 1, 0]`.) $(T2 swap, Swaps two values.) $(T2 swapAt, @@ -216,7 +216,7 @@ buffer. For example: /** The $(D front) range may actually "step over" the $(D back) range. This is very useful with forward ranges that cannot compute -comfortably right-bounded subranges like $(D arr[0 .. 4]) above. In +comfortably right-bounded subranges like `arr[0 .. 4]` above. In the example below, $(D r2) is a right subrange of $(D r1). */ @safe unittest @@ -1555,12 +1555,12 @@ algorithm. For example, consider an algorithm that sorts $(D [ "abc", "b", "aBc" ]) according to $(D toUpper(a) < toUpper(b)). That algorithm might choose to swap the two equivalent strings $(D "abc") and $(D "aBc"). That does not affect the sorting since both $(D [ -"abc", "aBc", "b" ]) and $(D [ "aBc", "abc", "b" ]) are valid +"abc", "aBc", "b" ]) and `[ "aBc", "abc", "b" ]` are valid outcomes. Some situations require that the algorithm must NOT ever change the relative ordering of equivalent elements (in the example above, only -$(D [ "abc", "aBc", "b" ]) would be the correct result). Such +`[ "abc", "aBc", "b" ]` would be the correct result). Such algorithms are called $(B stable). If the ordering algorithm may swap equivalent elements discretionarily, the ordering is called $(B unstable). @@ -1614,7 +1614,7 @@ std.algorithm) only change $(I content), not $(I topology). The value $(D 8) is repeated because $(LREF move) was invoked to move elements around and on integers $(D move) simply copies the source to the destination. To replace $(D a) with the effect of the removal, -simply assign $(D a = remove(a, 1)). The slice will be rebound to the +simply assign `a = remove(a, 1)`. The slice will be rebound to the shorter array and the operation completes with maximal efficiency. Multiple indices can be passed into $(D remove). In that case, @@ -1639,7 +1639,7 @@ assert(remove(a, 1, tuple(3, 5), 9) == [ 0, 2, 5, 6, 7, 8, 10 ]); In this case, the slots at positions 1, 3, 4, and 9 are removed from the array. The tuple passes in a range closed to the left and open to -the right (consistent with built-in slices), e.g. $(D tuple(3, 5)) +the right (consistent with built-in slices), e.g. `tuple(3, 5)` means indices $(D 3) and $(D 4) but not $(D 5). If the need is to remove some elements in the range but the order of @@ -1916,9 +1916,9 @@ if (s == SwapStrategy.stable /** Reduces the length of the bidirectional range $(D range) by removing -elements that satisfy $(D pred). If $(D s = SwapStrategy.unstable), +elements that satisfy `pred`. If `s = SwapStrategy.unstable`, elements are moved from the right end of the range over the elements -to eliminate. If $(D s = SwapStrategy.stable) (the default), +to eliminate. If `s = SwapStrategy.stable` (the default), elements are moved progressively to front such that their relative order is preserved. Returns the filtered range. @@ -2078,7 +2078,7 @@ if (isBidirectionalRange!Range // reverse /** -Reverses $(D r) in-place. Performs $(D r.length / 2) evaluations of $(D +Reverses `r` in-place. Performs `r.length / 2` evaluations of $(D swap). Params: r = a bidirectional range with swappable elements or a random access range with a length member diff --git a/std/algorithm/package.d b/std/algorithm/package.d index daf9540c28e..71f1f26065b 100644 --- a/std/algorithm/package.d +++ b/std/algorithm/package.d @@ -152,8 +152,8 @@ expression that uses the symbol $(D a) (for unary functions) or the symbols $(D a) and $(D b) (for binary functions). These names will NOT interfere with other homonym symbols in user code because they are evaluated in a different context. The default for all binary -comparison predicates is $(D "a == b") for unordered operations and -$(D "a < b") for ordered operations. +comparison predicates is `"a == b"` for unordered operations and +`"a < b"` for ordered operations. Example: diff --git a/std/algorithm/searching.d b/std/algorithm/searching.d index 639ee5bf800..10ad07314f1 100644 --- a/std/algorithm/searching.d +++ b/std/algorithm/searching.d @@ -6,57 +6,57 @@ It contains generic _searching algorithms. $(BOOKTABLE Cheat Sheet, $(TR $(TH Function Name) $(TH Description)) $(T2 all, - $(D all!"a > 0"([1, 2, 3, 4])) returns $(D true) because all elements + `all!"a > 0"([1, 2, 3, 4])` returns `true` because all elements are positive) $(T2 any, - $(D any!"a > 0"([1, 2, -3, -4])) returns $(D true) because at least one + `any!"a > 0"([1, 2, -3, -4])` returns `true` because at least one element is positive) $(T2 balancedParens, - $(D balancedParens("((1 + 1) / 2)")) returns $(D true) because the + `balancedParens("((1 + 1) / 2)")` returns `true` because the string has balanced parentheses.) $(T2 boyerMooreFinder, - $(D find("hello world", boyerMooreFinder("or"))) returns $(D "orld") + `find("hello world", boyerMooreFinder("or"))` returns `"orld"` using the $(LUCKY Boyer-Moore _algorithm).) $(T2 canFind, - $(D canFind("hello world", "or")) returns $(D true).) + `canFind("hello world", "or")` returns `true`.) $(T2 count, Counts elements that are equal to a specified value or satisfy a - predicate. $(D count([1, 2, 1], 1)) returns $(D 2) and - $(D count!"a < 0"([1, -3, 0])) returns $(D 1).) + predicate. `count([1, 2, 1], 1)` returns `2` and + `count!"a < 0"([1, -3, 0])` returns `1`.) $(T2 countUntil, - $(D countUntil(a, b)) returns the number of steps taken in $(D a) to - reach $(D b); for example, $(D countUntil("hello!", "o")) returns + `countUntil(a, b)` returns the number of steps taken in `a` to + reach `b`; for example, `countUntil("hello!", "o")` returns $(D 4).) $(T2 commonPrefix, - $(D commonPrefix("parakeet", "parachute")) returns $(D "para").) + `commonPrefix("parakeet", "parachute")` returns `"para"`.) $(T2 endsWith, - $(D endsWith("rocks", "ks")) returns $(D true).) + `endsWith("rocks", "ks")` returns `true`.) $(T2 find, - $(D find("hello world", "or")) returns $(D "orld") using linear search. + `find("hello world", "or")` returns `"orld"` using linear search. (For binary search refer to $(REF sortedRange, std,range).)) $(T2 findAdjacent, - $(D findAdjacent([1, 2, 3, 3, 4])) returns the subrange starting with - two equal adjacent elements, i.e. $(D [3, 3, 4]).) + `findAdjacent([1, 2, 3, 3, 4])` returns the subrange starting with + two equal adjacent elements, i.e. `[3, 3, 4]`.) $(T2 findAmong, - $(D findAmong("abcd", "qcx")) returns $(D "cd") because $(D 'c') is + `findAmong("abcd", "qcx")` returns `"cd"` because `'c'` is among $(D "qcx").) $(T2 findSkip, - If $(D a = "abcde"), then $(D findSkip(a, "x")) returns $(D false) and - leaves $(D a) unchanged, whereas $(D findSkip(a, "c")) advances $(D a) + If `a = "abcde"`, then `findSkip(a, "x")` returns `false` and + leaves `a` unchanged, whereas `findSkip(a, "c")` advances `a` to $(D "de") and returns $(D true).) $(T2 findSplit, - $(D findSplit("abcdefg", "de")) returns the three ranges $(D "abc"), + `findSplit("abcdefg", "de")` returns the three ranges `"abc"`, $(D "de"), and $(D "fg").) $(T2 findSplitAfter, - $(D findSplitAfter("abcdefg", "de")) returns the two ranges + `findSplitAfter("abcdefg", "de")` returns the two ranges $(D "abcde") and $(D "fg").) $(T2 findSplitBefore, - $(D findSplitBefore("abcdefg", "de")) returns the two ranges $(D "abc") + `findSplitBefore("abcdefg", "de")` returns the two ranges `"abc"` and $(D "defg").) $(T2 minCount, - $(D minCount([2, 1, 1, 4, 1])) returns $(D tuple(1, 3)).) + `minCount([2, 1, 1, 4, 1])` returns `tuple(1, 3)`.) $(T2 maxCount, - $(D maxCount([2, 4, 1, 4, 1])) returns $(D tuple(4, 2)).) + `maxCount([2, 4, 1, 4, 1])` returns `tuple(4, 2)`.) $(T2 minElement, Selects the minimal element of a range. `minElement([3, 4, 1, 2])` returns `1`.) @@ -70,22 +70,22 @@ $(T2 maxIndex, Index of the maximal element of a range. `maxElement([3, 4, 1, 2])` returns `1`.) $(T2 minPos, - $(D minPos([2, 3, 1, 3, 4, 1])) returns the subrange $(D [1, 3, 4, 1]), + `minPos([2, 3, 1, 3, 4, 1])` returns the subrange `[1, 3, 4, 1]`, i.e., positions the range at the first occurrence of its minimal element.) $(T2 maxPos, - $(D maxPos([2, 3, 1, 3, 4, 1])) returns the subrange $(D [4, 1]), + `maxPos([2, 3, 1, 3, 4, 1])` returns the subrange `[4, 1]`, i.e., positions the range at the first occurrence of its maximal element.) $(T2 mismatch, - $(D mismatch("parakeet", "parachute")) returns the two ranges + `mismatch("parakeet", "parachute")` returns the two ranges $(D "keet") and $(D "chute").) $(T2 skipOver, - Assume $(D a = "blah"). Then $(D skipOver(a, "bi")) leaves $(D a) - unchanged and returns $(D false), whereas $(D skipOver(a, "bl")) + Assume `a = "blah"`. Then `skipOver(a, "bi")` leaves `a` + unchanged and returns `false`, whereas `skipOver(a, "bl")` advances $(D a) to refer to $(D "ah") and returns $(D true).) $(T2 startsWith, - $(D startsWith("hello, world", "hello")) returns $(D true).) + `startsWith("hello, world", "hello")` returns `true`.) $(T2 until, Lazily iterates a range until a specific value is found.) ) @@ -407,7 +407,7 @@ Returns the common prefix of two ranges. Params: pred = The predicate to use in comparing elements for commonality. Defaults - to equality $(D "a == b"). + to equality `"a == b"`. r1 = A $(REF_ALTTEXT forward range, isForwardRange, std,range,primitives) of elements. @@ -418,7 +418,7 @@ Params: Returns: A slice of $(D r1) which contains the characters that both ranges start with, if the first argument is a string; otherwise, the same as the result of -$(D takeExactly(r1, n)), where $(D n) is the number of elements in the common +`takeExactly(r1, n)`, where `n` is the number of elements in the common prefix of both ranges. See_Also: @@ -592,13 +592,13 @@ if (isNarrowString!R1 && isNarrowString!R2) // count /** The first version counts the number of elements $(D x) in $(D r) for -which $(D pred(x, value)) is $(D true). $(D pred) defaults to +which `pred(x, value)` is `true`. `pred` defaults to equality. Performs $(BIGOH haystack.length) evaluations of $(D pred). The second version returns the number of times $(D needle) occurs in $(D haystack). Throws an exception if $(D needle.empty), as the _count of the empty range in any range would be infinite. Overlapped counts -are not considered, for example $(D count("aaa", "aa")) is $(D 1), not +are not considered, for example `count("aaa", "aa")` is `1`, not $(D 2). The third version counts the elements for which $(D pred(x)) is $(D @@ -739,8 +739,8 @@ if (isInputRange!R && !isInfinite!R && Returns: The number of elements which must be popped from the front of $(D haystack) before reaching an element for which - $(D startsWith!pred(haystack, needles)) is $(D true). If - $(D startsWith!pred(haystack, needles)) is not $(D true) for any element in + `startsWith!pred(haystack, needles)` is `true`. If + `startsWith!pred(haystack, needles)` is not `true` for any element in $(D haystack), then $(D -1) is returned. See_Also: $(REF indexOf, std,string) @@ -1348,8 +1348,8 @@ find(retro(haystack), needle)). See $(REF retro, std,range). Params: pred = The predicate for comparing each element with the needle, defaulting to -$(D "a == b"). -The negated predicate $(D "a != b") can be used to search instead for the first +`"a == b"`. +The negated predicate `"a != b"` can be used to search instead for the first element $(I not) matching the needle. haystack = The $(REF_ALTTEXT input range, isInputRange, std,range,primitives) @@ -1359,13 +1359,13 @@ needle = The element searched for. Constraints: -$(D isInputRange!InputRange && is(typeof(binaryFun!pred(haystack.front, needle) +`isInputRange!InputRange && is(typeof(binaryFun!pred(haystack.front, needle) : bool))) Returns: $(D haystack) advanced such that the front element is the one searched for; -that is, until $(D binaryFun!pred(haystack.front, needle)) is $(D true). If no +that is, until `binaryFun!pred(haystack.front, needle)` is `true`. If no such position exists, returns an empty $(D haystack). See_Also: @@ -1683,7 +1683,7 @@ search in. Returns: $(D haystack) advanced such that the front element is the one searched for; -that is, until $(D binaryFun!pred(haystack.front, needle)) is $(D true). If no +that is, until `binaryFun!pred(haystack.front, needle)` is `true`. If no such position exists, returns an empty $(D haystack). See_Also: @@ -1754,7 +1754,7 @@ possible), depending on the statistics of the two ranges' content. Params: pred = The predicate to use for comparing respective elements from the haystack -and the needle. Defaults to simple equality $(D "a == b"). +and the needle. Defaults to simple equality `"a == b"`. haystack = The $(REF_ALTTEXT forward range, isForwardRange, std,range,primitives) searched in. @@ -2430,7 +2430,7 @@ template canFind(alias pred="a == b") will be $(D true) if one of the needles is found and $(D false) if none are found, whereas if the result is used elsewhere, it can either be cast to $(D bool) for the same effect or used to get which needle was found first - without having to deal with the tuple that $(D LREF find) returns for the + without having to deal with the tuple that `LREF find` returns for the same operation. +/ size_t canFind(Range, Ranges...)(Range haystack, scope Ranges needles) @@ -2493,7 +2493,7 @@ template canFind(alias pred="a == b") // findAdjacent /** Advances $(D r) until it finds the first two adjacent elements $(D a), -$(D b) that satisfy $(D pred(a, b)). Performs $(BIGOH r.length) +`b` that satisfy `pred(a, b)`. Performs $(BIGOH r.length) evaluations of $(D pred). Params: @@ -3046,16 +3046,16 @@ if (isForwardRange!R1 && isForwardRange!R2) Computes the minimum (respectively maximum) of `range` along with its number of occurrences. Formally, the minimum is a value `x` in `range` such that $(D pred(a, x)) is `false` for all values `a` in `range`. Conversely, the maximum is -a value `x` in `range` such that $(D pred(x, a)) is `false` for all values `a` +a value `x` in `range` such that `pred(x, a)` is `false` for all values `a` in `range` (note the swapped arguments to `pred`). These functions may be used for computing arbitrary extrema by choosing `pred` appropriately. For corrrect functioning, `pred` must be a strict partial order, -i.e. transitive (if $(D pred(a, b) && pred(b, c)) then $(D pred(a, c))) and -irreflexive ($(D pred(a, a)) is `false`). The $(LUCKY trichotomy property of +i.e. transitive (if `pred(a, b) && pred(b, c)` then `pred(a, c)`) and +irreflexive (`pred(a, a)` is `false`). The $(LUCKY trichotomy property of inequality) is not required: these algoritms consider elements `a` and `b` equal (for the purpose of counting) if `pred` puts them in the same equivalence class, -i.e. $(D !pred(a, b) && !pred(b, a)). +i.e. `!pred(a, b) && !pred(b, a)`. Params: pred = The ordering predicate to use to determine the extremum (minimum @@ -3457,15 +3457,15 @@ Computes a subrange of `range` starting at the first occurrence of `range`'s minimum (respectively maximum) and with the same ending as `range`, or the empty range if `range` itself is empty. -Formally, the minimum is a value `x` in `range` such that $(D pred(a, x)) is +Formally, the minimum is a value `x` in `range` such that `pred(a, x)` is `false` for all values `a` in `range`. Conversely, the maximum is a value `x` in -`range` such that $(D pred(x, a)) is `false` for all values `a` in `range` (note +`range` such that `pred(x, a)` is `false` for all values `a` in `range` (note the swapped arguments to `pred`). These functions may be used for computing arbitrary extrema by choosing `pred` appropriately. For corrrect functioning, `pred` must be a strict partial order, -i.e. transitive (if $(D pred(a, b) && pred(b, c)) then $(D pred(a, c))) and -irreflexive ($(D pred(a, a)) is `false`). +i.e. transitive (if `pred(a, b) && pred(b, c)` then `pred(a, c)`) and +irreflexive (`pred(a, a)` is `false`). Params: pred = The ordering predicate to use to determine the extremum (minimum or @@ -3789,7 +3789,7 @@ range, or do nothing if there is no match. Params: pred = The predicate that determines whether elements from each respective - range match. Defaults to equality $(D "a == b"). + range match. Defaults to equality `"a == b"`. r1 = The $(REF_ALTTEXT forward range, isForwardRange, std,range,primitives) to move forward. r2 = The $(REF_ALTTEXT input range, isInputRange, std,range,primitives) @@ -4281,7 +4281,7 @@ alias OpenRight = Flag!"openRight"; /** Lazily iterates $(D range) _until the element $(D e) for which -$(D pred(e, sentinel)) is true. +`pred(e, sentinel)` is true. Params: pred = Predicate to determine when to stop. diff --git a/std/algorithm/sorting.d b/std/algorithm/sorting.d index 20d30c9280e..b50e7991cc5 100644 --- a/std/algorithm/sorting.d +++ b/std/algorithm/sorting.d @@ -6,23 +6,23 @@ It contains generic _sorting algorithms. $(BOOKTABLE Cheat Sheet, $(TR $(TH Function Name) $(TH Description)) $(T2 completeSort, - If $(D a = [10, 20, 30]) and $(D b = [40, 6, 15]), then - $(D completeSort(a, b)) leaves $(D a = [6, 10, 15]) and $(D b = [20, + If `a = [10, 20, 30]` and `b = [40, 6, 15]`, then + `completeSort(a, b)` leaves `a = [6, 10, 15]` and `b = [20, 30, 40]). The range $(D a) must be sorted prior to the call, and as a result the - combination $(D $(REF chain, std,range)(a, b)) is sorted.) + combination `$(REF chain, std,range)(a, b)` is sorted.) $(T2 isPartitioned, - $(D isPartitioned!"a < 0"([-1, -2, 1, 0, 2])) returns $(D true) because + `isPartitioned!"a < 0"([-1, -2, 1, 0, 2])` returns `true` because the predicate is $(D true) for a portion of the range and $(D false) afterwards.) $(T2 isSorted, - $(D isSorted([1, 1, 2, 3])) returns $(D true).) + `isSorted([1, 1, 2, 3])` returns `true`.) $(T2 isStrictlyMonotonic, - $(D isStrictlyMonotonic([1, 1, 2, 3])) returns $(D false).) + `isStrictlyMonotonic([1, 1, 2, 3])` returns `false`.) $(T2 ordered, - $(D ordered(1, 1, 2, 3)) returns $(D true).) + `ordered(1, 1, 2, 3)` returns `true`.) $(T2 strictlyOrdered, - $(D strictlyOrdered(1, 1, 2, 3)) returns $(D false).) + `strictlyOrdered(1, 1, 2, 3)` returns `false`.) $(T2 makeIndex, Creates a separate index for a range.) $(T2 merge, @@ -36,8 +36,8 @@ $(T2 nextPermutation, Computes the next lexicographically greater permutation of a range in-place.) $(T2 partialSort, - If $(D a = [5, 4, 3, 2, 1]), then $(D partialSort(a, 3)) leaves - $(D a[0 .. 3] = [1, 2, 3]). + If `a = [5, 4, 3, 2, 1]`, then `partialSort(a, 3)` leaves + `a[0 .. 3] = [1, 2, 3]`. The other elements of $(D a) are left in an unspecified order.) $(T2 partition, Partitions a range according to a unary predicate.) @@ -95,7 +95,7 @@ alias SortOutput = Flag!"sortOutput"; // completeSort /** -Sorts the random-access range $(D chain(lhs, rhs)) according to +Sorts the random-access range `chain(lhs, rhs)` according to predicate $(D less). The left-hand side of the range $(D lhs) is assumed to be already sorted; $(D rhs) is assumed to be unsorted. The exact strategy chosen depends on the relative sizes of $(D lhs) and @@ -294,12 +294,12 @@ Like $(D isSorted), returns $(D true) if the given $(D values) are ordered according to the comparison operation $(D less). Unlike $(D isSorted), takes values directly instead of structured in a range. -$(D ordered) allows repeated values, e.g. $(D ordered(1, 1, 2)) is $(D true). To verify +`ordered` allows repeated values, e.g. `ordered(1, 1, 2)` is `true`. To verify that the values are ordered strictly monotonically, use $(D strictlyOrdered); -$(D strictlyOrdered(1, 1, 2)) is $(D false). +`strictlyOrdered(1, 1, 2)` is `false`. With either function, the predicate must be a strict ordering. For example, -using $(D "a <= b") instead of $(D "a < b") is incorrect and will cause failed +using `"a <= b"` instead of `"a < b"` is incorrect and will cause failed assertions. Params: @@ -366,7 +366,7 @@ if (is(typeof(ordered!less(values)))) // partition /** Partitions a range in two using the given $(D predicate). -Specifically, reorders the range $(D r = [left, right$(RPAREN)) using $(D swap) +Specifically, reorders the range `r = [left, right$(RPAREN)` using `swap` such that all elements $(D i) for which $(D predicate(i)) is $(D true) come before all elements $(D j) for which $(D predicate(j)) returns $(D false). @@ -385,9 +385,9 @@ Returns: The right part of $(D r) after partitioning. -If $(D ss == SwapStrategy.stable), $(D partition) preserves the relative +If `ss == SwapStrategy.stable`, `partition` preserves the relative ordering of all elements $(D a), $(D b) in $(D r) for which $(D predicate(a) == -predicate(b)). If $(D ss == SwapStrategy.semistable), $(D partition) preserves +predicate(b)). If `ss == SwapStrategy.semistable`, `partition` preserves the relative ordering of all elements $(D a), $(D b) in the left part of $(D r) for which $(D predicate(a) == predicate(b)). @@ -574,17 +574,17 @@ if (ss != SwapStrategy.stable && isInputRange!Range && hasSwappableElements!Rang Partitions `r` around `pivot` using comparison function `less`, algorithm akin to $(LUCKY Hoare partition). Specifically, permutes elements of `r` and returns -an index $(D k < r.length) such that: +an index `k < r.length` such that: $(UL $(LI `r[pivot]` is swapped to `r[k]`) -$(LI All elements `e` in subrange $(D r[0 .. k]) satisfy $(D !less(r[k], e)) +$(LI All elements `e` in subrange `r[0 .. k]` satisfy `!less(r[k], e)` (i.e. `r[k]` is greater than or equal to each element to its left according to predicate `less`)) -$(LI All elements `e` in subrange $(D r[0 .. k]) satisfy $(D !less(e, +$(LI All elements `e` in subrange `r[0 .. k]` satisfy `!less(e, r[k])) (i.e. `r[k]` is less than or equal to each element to its right according to predicate `less`))) @@ -935,7 +935,7 @@ Params: index = The resulting index. Returns: The pointer-based version returns a $(D SortedRange) wrapper -over index, of type $(D SortedRange!(RangeIndex, (a, b) => +over index, of type `SortedRange!(RangeIndex, (a, b) => binaryFun!less(*a, *b))) thus reflecting the ordering of the index. The index-based version returns $(D void) because the ordering relation involves not only $(D index) but also $(D r). @@ -1417,7 +1417,7 @@ private template validPredicates(E, less...) } /** -$(D auto multiSort(Range)(Range r) +`auto multiSort(Range)(Range r) if (validPredicates!(ElementType!Range, less));) Sorts a range by multiple keys. The call $(D multiSort!("a.id < b.id", @@ -1800,7 +1800,7 @@ behave as expected - otherwise, the program may fail on certain inputs (but not others) when not compiled in release mode, due to the cursory $(D assumeSorted) check. Specifically, $(D sort) expects $(D less(a,b) && less(b,c)) to imply $(D less(a,c)) (transitivity), and, conversely, $(D !less(a,b) && !less(b,c)) to -imply $(D !less(a,c)). Note that the default predicate ($(D "a < b")) does not +imply `!less(a,c)`. Note that the default predicate (`"a < b"`) does not always satisfy these conditions for floating point types, because the expression will always be $(D false) when either $(D a) or $(D b) is NaN. Use $(REF cmp, std,math) instead. @@ -2882,7 +2882,7 @@ Params: r = The range to sort. Returns: The initial range wrapped as a $(D SortedRange) with the -predicate $(D (a, b) => binaryFun!less(transform(a), +predicate `(a, b) => binaryFun!less(transform(a), transform(b))). */ SortedRange!(R, ((a, b) => binaryFun!less(unaryFun!transform(a), @@ -3005,9 +3005,9 @@ if (isRandomAccessRange!R && hasLength!R) /** Reorders the random-access range $(D r) such that the range $(D r[0 .. mid]) is the same as if the entire $(D r) were sorted, and leaves -the range $(D r[mid .. r.length]) in no particular order. Performs +the range `r[mid .. r.length]` in no particular order. Performs $(BIGOH r.length * log(mid)) evaluations of $(D pred). The -implementation simply calls $(D topN!(less, ss)(r, n)) and then $(D +implementation simply calls `topN!(less, ss)(r, n)` and then $(D sort!(less, ss)(r[0 .. n])). Params: @@ -3065,14 +3065,14 @@ if (isRandomAccessRange!(Range1) && hasLength!Range1 && Reorders the range $(D r) using $(D swap) such that $(D r[nth]) refers to the element that would fall there if the range were fully sorted. In addition, it also partitions $(D r) such that all elements -$(D e1) from $(D r[0]) to $(D r[nth]) satisfy $(D !less(r[nth], e1)), +`e1` from `r[0]` to `r[nth]` satisfy `!less(r[nth], e1)`, and all elements $(D e2) from $(D r[nth]) to $(D r[r.length]) satisfy -$(D !less(e2, r[nth])). Effectively, it finds the nth smallest +`!less(e2, r[nth])`. Effectively, it finds the nth smallest (according to $(D less)) elements in $(D r). Performs an expected $(BIGOH r.length) (if unstable) or $(BIGOH r.length * log(r.length)) (if stable) evaluations of $(D less) and $(D swap). -If $(D n >= r.length), the algorithm has no effect and returns +If `n >= r.length`, the algorithm has no effect and returns `r[0 .. r.length]`. Params: @@ -3723,7 +3723,7 @@ Similar to $(LREF topN), except that the range is not modified. Params: less = A binary predicate that defines the ordering of range elements. - Defaults to $(D a < b). + Defaults to `a < b`. ss = $(RED (Not implemented yet.)) Specify the swapping strategy. r = A $(REF_ALTTEXT random-access range, isRandomAccessRange, std,range,primitives) @@ -3857,7 +3857,7 @@ Private for the time being. Computes the median of 2 to 5 arbitrary indexes in random-access range `r` using hand-written specialized algorithms. The indexes must be distinct (if not, behavior is implementation-defined). The function also partitions the elements -involved around the median, e.g. $(D medianOf(r, a, b, c)) not only fills `r[b]` +involved around the median, e.g. `medianOf(r, a, b, c)` not only fills `r[b]` with the median of `r[a]`, `r[b]`, and `r[c]`, but also puts the minimum in `r[a]` and the maximum in `r[c]`. @@ -3866,9 +3866,9 @@ less = The comparison predicate used, modeled as a $(LUCKY strict weak ordering) (irreflexive, antisymmetric, transitive, and implying a transitive equivalence). flag = Used only for even values of `T.length`. If `No.leanRight`, the median -"leans left", meaning $(D medianOf(r, a, b, c, d)) puts the lower median of the +"leans left", meaning `medianOf(r, a, b, c, d)` puts the lower median of the four in `r[b]`, the minimum in `r[a]`, and the two others in `r[c]` and `r[d]`. -Conversely, $(D median!("a < b", Yes.leanRight)(r, a, b, c, d)) puts the upper +Conversely, `median!("a < b", Yes.leanRight)(r, a, b, c, d)` puts the upper median of the four in `r[c]`, the maximum in `r[d]`, and the two others in `r[a]` and `r[b]`. r = The range containing the indexes. diff --git a/std/array.d b/std/array.d index 2a6d087aba4..b00c7b7bd2a 100644 --- a/std/array.d +++ b/std/array.d @@ -7,60 +7,60 @@ This module provides all kinds of functions to create, manipulate or convert arr $(BOOKTABLE , $(TR $(TH Function Name) $(TH Description) ) - $(TR $(TD $(D $(LREF _array))) + $(TR $(TD `$(LREF _array)`) $(TD Returns a copy of the input in a newly allocated dynamic _array. )) - $(TR $(TD $(D $(LREF appender))) + $(TR $(TD `$(LREF appender)`) $(TD Returns a new Appender initialized with a given _array. )) - $(TR $(TD $(D $(LREF assocArray))) + $(TR $(TD `$(LREF assocArray)`) $(TD Returns a newly allocated associative _array from a range of key/value tuples. )) - $(TR $(TD $(D $(LREF byPair))) + $(TR $(TD `$(LREF byPair)`) $(TD Construct a range iterating over an associative _array by key/value tuples. )) - $(TR $(TD $(D $(LREF insertInPlace))) + $(TR $(TD `$(LREF insertInPlace)`) $(TD Inserts into an existing _array at a given position. )) - $(TR $(TD $(D $(LREF join))) + $(TR $(TD `$(LREF join)`) $(TD Concatenates a range of ranges into one _array. )) - $(TR $(TD $(D $(LREF minimallyInitializedArray))) + $(TR $(TD `$(LREF minimallyInitializedArray)`) $(TD Returns a new _array of type $(D T). )) - $(TR $(TD $(D $(LREF replace))) + $(TR $(TD `$(LREF replace)`) $(TD Returns a new _array with all occurrences of a certain subrange replaced. )) - $(TR $(TD $(D $(LREF replaceFirst))) + $(TR $(TD `$(LREF replaceFirst)`) $(TD Returns a new _array with the first occurrence of a certain subrange replaced. )) - $(TR $(TD $(D $(LREF replaceInPlace))) + $(TR $(TD `$(LREF replaceInPlace)`) $(TD Replaces all occurrences of a certain subrange and puts the result into a given _array. )) - $(TR $(TD $(D $(LREF replaceInto))) + $(TR $(TD `$(LREF replaceInto)`) $(TD Replaces all occurrences of a certain subrange and puts the result into an output range. )) - $(TR $(TD $(D $(LREF replaceLast))) + $(TR $(TD `$(LREF replaceLast)`) $(TD Returns a new _array with the last occurrence of a certain subrange replaced. )) - $(TR $(TD $(D $(LREF replaceSlice))) + $(TR $(TD `$(LREF replaceSlice)`) $(TD Returns a new _array with a given slice replaced. )) - $(TR $(TD $(D $(LREF replicate))) + $(TR $(TD `$(LREF replicate)`) $(TD Creates a new _array out of several copies of an input _array or range. )) - $(TR $(TD $(D $(LREF sameHead))) + $(TR $(TD `$(LREF sameHead)`) $(TD Checks if the initial segments of two arrays refer to the same place in memory. )) - $(TR $(TD $(D $(LREF sameTail))) + $(TR $(TD `$(LREF sameTail)`) $(TD Checks if the final segments of two arrays refer to the same place in memory. )) - $(TR $(TD $(D $(LREF split))) + $(TR $(TD `$(LREF split)`) $(TD Eagerly split a range or string into an _array. )) - $(TR $(TD $(D $(LREF uninitializedArray))) + $(TR $(TD `$(LREF uninitializedArray)`) $(TD Returns a new _array of type $(D T) without initializing its elements. )) ) @@ -2652,7 +2652,7 @@ body /** Implements an output range that appends data to an array. This is -recommended over $(D array ~= data) when appending many elements because it is more +recommended over `array ~= data` when appending many elements because it is more efficient. `Appender` maintains its own array metadata locally, so it can avoid global locking for each append where $(LREF capacity) is non-zero. See_Also: $(LREF appender) diff --git a/std/base64.d b/std/base64.d index 5995c525f5a..ba374c43452 100644 --- a/std/base64.d +++ b/std/base64.d @@ -4,12 +4,12 @@ * Support for Base64 encoding and decoding. * * This module provides two default implementations of Base64 encoding, - * $(D $(LREF Base64)) with a standard encoding alphabet, and a variant - * $(D $(LREF Base64URL)) that has a modified encoding alphabet designed to be + * `$(LREF Base64)` with a standard encoding alphabet, and a variant + * `$(LREF Base64URL)` that has a modified encoding alphabet designed to be * safe for embedding in URLs and filenames. * * Both variants are implemented as instantiations of the template - * $(D $(LREF Base64Impl)). Most users will not need to use this template + * `$(LREF Base64Impl)`. Most users will not need to use this template * directly; however, it can be used to create customized Base64 encodings, * such as one that omits padding characters, or one that is safe to embed * inside a regular expression. @@ -76,7 +76,7 @@ import std.traits; // isArray /** * Implementation of standard _Base64 encoding. * - * See $(D $(LREF Base64Impl)) for a description of available methods. + * See `$(LREF Base64Impl)` for a description of available methods. */ alias Base64 = Base64Impl!('+', '/'); @@ -92,7 +92,7 @@ alias Base64 = Base64Impl!('+', '/'); /** * Variation of Base64 encoding that is safe for use in URLs and filenames. * - * See $(D $(LREF Base64Impl)) for a description of available methods. + * See `$(LREF Base64Impl)` for a description of available methods. */ alias Base64URL = Base64Impl!('-', '_'); @@ -109,8 +109,8 @@ alias Base64URL = Base64Impl!('-', '_'); * Template for implementing Base64 encoding and decoding. * * For most purposes, direct usage of this template is not necessary; instead, - * this module provides two default implementations: $(D $(LREF Base64)) and - * $(D $(LREF Base64URL)), that implement basic Base64 encoding and a variant + * this module provides two default implementations: `$(LREF Base64)` and + * `$(LREF Base64URL)`, that implement basic Base64 encoding and a variant * intended for use in URLs and filenames, respectively. * * Customized Base64 encoding schemes can be implemented by instantiating this diff --git a/std/bigint.d b/std/bigint.d index 5f2e2b2b07a..c9c33465214 100644 --- a/std/bigint.d +++ b/std/bigint.d @@ -207,7 +207,7 @@ public: /** * Implements assignment operators from built-in integers of the form - * $(D BigInt op= integer). + * `BigInt op= integer`. */ BigInt opOpAssign(string op, T)(T y) pure nothrow if ((op=="+" || op=="-" || op=="*" || op=="/" || op=="%" @@ -310,7 +310,7 @@ public: } /** - * Implements assignment operators of the form $(D BigInt op= BigInt). + * Implements assignment operators of the form `BigInt op= BigInt`. */ BigInt opOpAssign(string op, T)(T y) pure nothrow if ((op=="+" || op== "-" || op=="*" || op=="|" || op=="&" || op=="^" || op=="/" || op=="%") diff --git a/std/complex.d b/std/complex.d index 1ce874dbd24..a84ab7102dd 100644 --- a/std/complex.d +++ b/std/complex.d @@ -32,7 +32,7 @@ import std.traits; to the values provided as input. If neither $(D re) nor $(D im) are floating-point numbers, the return type will be $(D Complex!double). Otherwise, the return type is - deduced using $(D std.traits.CommonType!(R, I)). + deduced using `std.traits.CommonType!(R, I)`. */ auto complex(R)(R re) @safe pure nothrow @nogc if (is(R : double)) diff --git a/std/container/array.d b/std/container/array.d index cc595b8b649..0c04f2550cd 100644 --- a/std/container/array.d +++ b/std/container/array.d @@ -538,7 +538,7 @@ Complexity: $(BIGOH 1) /** Ensures sufficient capacity to accommodate $(D e) elements. -Postcondition: $(D capacity >= e) +Postcondition: `capacity >= e` Complexity: $(BIGOH 1) */ @@ -589,7 +589,7 @@ Complexity: $(BIGOH 1) Returns a range that iterates over elements of the container from index $(D i) up to (excluding) index $(D j). -Precondition: $(D i <= j && j <= length) +Precondition: `i <= j && j <= length` Complexity: $(BIGOH 1) */ @@ -632,7 +632,7 @@ Complexity: $(BIGOH 1) /** Indexing operators yield or modify the value at a specified index. -Precondition: $(D i < length) +Precondition: `i < length` Complexity: $(BIGOH 1) */ @@ -645,7 +645,7 @@ Complexity: $(BIGOH 1) /** Slicing operations execute an operation on an entire slice. -Precondition: $(D i < j && j < length) +Precondition: `i < j && j < length` Complexity: $(BIGOH slice.length) */ @@ -750,7 +750,7 @@ T.init). Complexity: $(BIGOH abs(n - newLength)) -Postcondition: $(D length == newLength) +Postcondition: `length == newLength` */ @property void length(size_t newLength) { @@ -823,7 +823,7 @@ Complexity: $(BIGOH log(n)). Removes $(D howMany) values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove $(D howMany) elements. Instead, -if $(D howMany > n), all elements are removed. The returned value is +if `howMany > n`, all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. @@ -1663,9 +1663,9 @@ if (is(Unqual!T == bool)) /** Ensures sufficient capacity to accommodate $(D n) elements. - Postcondition: $(D capacity >= n) + Postcondition: `capacity >= n` - Complexity: $(BIGOH log(e - capacity)) if $(D e > capacity), + Complexity: $(BIGOH log(e - capacity)) if `e > capacity`, otherwise $(BIGOH 1). */ void reserve(size_t e) @@ -1863,7 +1863,7 @@ if (is(Unqual!T == bool)) // } /** - Forwards to $(D insertAfter(this[], stuff)). + Forwards to `insertAfter(this[], stuff)`. */ // @@@BUG@@@ //ref Array!bool opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~") @@ -1916,7 +1916,7 @@ if (is(Unqual!T == bool)) Complexity: $(BIGOH abs(n - newLength)) - Postcondition: $(D _length == newLength) + Postcondition: `_length == newLength` */ @property void length(size_t newLength) { @@ -2063,7 +2063,7 @@ if (is(Unqual!T == bool)) stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. The optional parameter $(D howMany) instructs removal of that many - elements. If $(D howMany > n), all elements are removed and no + elements. If `howMany > n`, all elements are removed and no exception is thrown. Precondition: $(D !empty) @@ -2092,7 +2092,7 @@ if (is(Unqual!T == bool)) Removes $(D howMany) values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove $(D howMany) - elements. Instead, if $(D howMany > n), all elements are + elements. Instead, if `howMany > n`, all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. diff --git a/std/container/binaryheap.d b/std/container/binaryheap.d index be520337e22..a44adf2f682 100644 --- a/std/container/binaryheap.d +++ b/std/container/binaryheap.d @@ -49,7 +49,7 @@ removeFront()) method) is done fast in $(BIGOH log n) time. If $(D less) is the less-than operator, which is the default option, then $(D BinaryHeap) defines a so-called max-heap that optimizes extraction of the $(I largest) elements. To define a min-heap, -instantiate BinaryHeap with $(D "a > b") as its predicate. +instantiate BinaryHeap with `"a > b"` as its predicate. Simply extracting elements from a $(D BinaryHeap) container is tantamount to lazily fetching elements of $(D Store) in descending @@ -258,7 +258,7 @@ Clears the heap by detaching it from the underlying store. /** Inserts $(D value) into the store. If the underlying store is a range -and $(D length == capacity), throws an exception. +and `length == capacity`, throws an exception. */ size_t insert(ElementType!Store value) { @@ -355,7 +355,7 @@ Replaces the largest element in the store with $(D value). /** If the heap has room to grow, inserts $(D value) into the store and -returns $(D true). Otherwise, if $(D less(value, front)), calls $(D +returns `true`. Otherwise, if `less(value, front)`, calls $(D replaceFront(value)) and returns again $(D true). Otherwise, leaves the heap unaffected and returns $(D false). This method is useful in scenarios where the smallest $(D k) elements of a set of candidates @@ -380,7 +380,7 @@ must be collected. } /** -Swapping is allowed if the heap is full. If $(D less(value, front)), the +Swapping is allowed if the heap is full. If `less(value, front)`, the method exchanges store.front and value and returns $(D true). Otherwise, it leaves the heap unaffected and returns $(D false). */ diff --git a/std/container/dlist.d b/std/container/dlist.d index a8538fbcb20..f3d2462a9e5 100644 --- a/std/container/dlist.d +++ b/std/container/dlist.d @@ -552,7 +552,7 @@ Complexity: $(BIGOH 1). Removes $(D howMany) values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove $(D howMany) elements. Instead, -if $(D howMany > n), all elements are removed. The returned value is +if `howMany > n`, all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. diff --git a/std/container/package.d b/std/container/package.d index fa0050555d3..2f25534be0b 100644 --- a/std/container/package.d +++ b/std/container/package.d @@ -211,8 +211,8 @@ primitive is implemented, it must support the syntax described in the $(B syntax) column with the semantics described in the $(B description) column, and it must not have a worst-case complexity worse than denoted in big-O notation in the $(BIGOH ·) column. Below, $(D C) means a _container type, $(D c) is -a value of _container type, $(D n$(SUBSCRIPT x)) represents the effective length of -value $(D x), which could be a single element (in which case $(D n$(SUBSCRIPT x)) is +a value of _container type, `n$(SUBSCRIPT x)` represents the effective length of +value `x`, which could be a single element (in which case `n$(SUBSCRIPT x)` is $(D 1)), a _container, or a range. $(BOOKTABLE Container primitives, @@ -223,24 +223,24 @@ $(TR ) $(TR $(TDNW $(D C(x))) - $(TDNW $(D n$(SUBSCRIPT x))) + $(TDNW `n$(SUBSCRIPT x)`) $(TD Creates a _container of type $(D C) from either another _container or a range. The created _container must not be a null reference even if x is empty.) ) $(TR $(TDNW $(D c.dup)) - $(TDNW $(D n$(SUBSCRIPT c))) + $(TDNW `n$(SUBSCRIPT c)`) $(TD Returns a duplicate of the _container.) ) $(TR - $(TDNW $(D c ~ x)) - $(TDNW $(D n$(SUBSCRIPT c) + n$(SUBSCRIPT x))) + $(TDNW `c ~ x`) + $(TDNW `n$(SUBSCRIPT c) + n$(SUBSCRIPT x)`) $(TD Returns the concatenation of $(D c) and $(D r). $(D x) may be a single element or an input range.) ) $(TR - $(TDNW $(D x ~ c)) - $(TDNW $(D n$(SUBSCRIPT c) + n$(SUBSCRIPT x))) + $(TDNW `x ~ c`) + $(TDNW `n$(SUBSCRIPT c) + n$(SUBSCRIPT x)`) $(TD Returns the concatenation of $(D x) and $(D c). $(D x) may be a single element or an input range type.) ) @@ -253,13 +253,13 @@ $(TR ) $(TR $(TD $(D c[])) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Returns a range iterating over the entire _container, in a _container-defined order.) ) $(TR - $(TDNW $(D c[a .. b])) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `c[a .. b]`) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Fetches a portion of the _container from key $(D a) to key $(D b).) ) $(LEADINGROWN 3, Capacity @@ -271,224 +271,224 @@ $(TR ) $(TR $(TD $(D c.length)) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Returns the number of elements in the _container.) ) $(TR - $(TDNW $(D c.length = n)) - $(TDNW $(D n$(SUBSCRIPT c) + n)) + $(TDNW `c.length = n`) + $(TDNW `n$(SUBSCRIPT c) + n`) $(TD Forces the number of elements in the _container to $(D n). If the _container ends up growing, the added elements are initialized in a _container-dependent manner (usually with $(D T.init)).) ) $(TR $(TD $(D c.capacity)) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Returns the maximum number of elements that can be stored in the _container without triggering a reallocation.) ) $(TR $(TD $(D c.reserve(x))) - $(TD $(D n$(SUBSCRIPT c))) + $(TD `n$(SUBSCRIPT c)`) $(TD Forces $(D capacity) to at least $(D x) without reducing it.) ) $(LEADINGROWN 3, Access ) $(TR $(TDNW $(D c.front)) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Returns the first element of the _container, in a _container-defined order.) ) $(TR $(TDNW $(D c.moveFront)) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Destructively reads and returns the first element of the _container. The slot is not removed from the _container; it is left initialized with $(D T.init). This routine need not be defined if $(D front) returns a $(D ref).) ) $(TR - $(TDNW $(D c.front = v)) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `c.front = v`) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Assigns $(D v) to the first element of the _container.) ) $(TR $(TDNW $(D c.back)) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Returns the last element of the _container, in a _container-defined order.) ) $(TR $(TDNW $(D c.moveBack)) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Destructively reads and returns the last element of the _container. The slot is not removed from the _container; it is left initialized with $(D T.init). This routine need not be defined if $(D front) returns a $(D ref).) ) $(TR - $(TDNW $(D c.back = v)) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `c.back = v`) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Assigns $(D v) to the last element of the _container.) ) $(TR $(TDNW $(D c[x])) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Provides indexed access into the _container. The index type is _container-defined. A _container may define several index types (and consequently overloaded indexing).) ) $(TR $(TDNW $(D c.moveAt(x))) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Destructively reads and returns the value at position $(D x). The slot is not removed from the _container; it is left initialized with $(D T.init).) ) $(TR - $(TDNW $(D c[x] = v)) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `c[x] = v`) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Sets element at specified index into the _container.) ) $(TR - $(TDNW $(D c[x] $(I op)= v)) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `c[x] $(I op)= v`) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Performs read-modify-write operation at specified index into the _container.) ) $(LEADINGROWN 3, Operations ) $(TR - $(TDNW $(D e in c)) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `e in c`) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Returns nonzero if e is found in $(D c).) ) $(TR $(TDNW $(D c.lowerBound(v))) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Returns a range of all elements strictly less than $(D v).) ) $(TR $(TDNW $(D c.upperBound(v))) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Returns a range of all elements strictly greater than $(D v).) ) $(TR $(TDNW $(D c.equalRange(v))) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Returns a range of all elements in $(D c) that are equal to $(D v).) ) $(LEADINGROWN 3, Modifiers ) $(TR - $(TDNW $(D c ~= x)) - $(TDNW $(D n$(SUBSCRIPT c) + n$(SUBSCRIPT x))) + $(TDNW `c ~= x`) + $(TDNW `n$(SUBSCRIPT c) + n$(SUBSCRIPT x)`) $(TD Appends $(D x) to $(D c). $(D x) may be a single element or an input range type.) ) $(TR $(TDNW $(D c.clear())) - $(TDNW $(D n$(SUBSCRIPT c))) + $(TDNW `n$(SUBSCRIPT c)`) $(TD Removes all elements in $(D c).) ) $(TR $(TDNW $(D c.insert(x))) - $(TDNW $(D n$(SUBSCRIPT x) * log n$(SUBSCRIPT c))) + $(TDNW `n$(SUBSCRIPT x) * log n$(SUBSCRIPT c)`) $(TD Inserts $(D x) in $(D c) at a position (or positions) chosen by $(D c).) ) $(TR $(TDNW $(D c.stableInsert(x))) - $(TDNW $(D n$(SUBSCRIPT x) * log n$(SUBSCRIPT c))) + $(TDNW `n$(SUBSCRIPT x) * log n$(SUBSCRIPT c)`) $(TD Same as $(D c.insert(x)), but is guaranteed to not invalidate any ranges.) ) $(TR $(TDNW $(D c.linearInsert(v))) - $(TDNW $(D n$(SUBSCRIPT c))) + $(TDNW `n$(SUBSCRIPT c)`) $(TD Same as $(D c.insert(v)) but relaxes complexity to linear.) ) $(TR $(TDNW $(D c.stableLinearInsert(v))) - $(TDNW $(D n$(SUBSCRIPT c))) + $(TDNW `n$(SUBSCRIPT c)`) $(TD Same as $(D c.stableInsert(v)) but relaxes complexity to linear.) ) $(TR $(TDNW $(D c.removeAny())) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Removes some element from $(D c) and returns it.) ) $(TR $(TDNW $(D c.stableRemoveAny())) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Same as $(D c.removeAny()), but is guaranteed to not invalidate any iterators.) ) $(TR $(TDNW $(D c.insertFront(v))) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Inserts $(D v) at the front of $(D c).) ) $(TR $(TDNW $(D c.stableInsertFront(v))) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Same as $(D c.insertFront(v)), but guarantees no ranges will be invalidated.) ) $(TR $(TDNW $(D c.insertBack(v))) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Inserts $(D v) at the back of $(D c).) ) $(TR $(TDNW $(D c.stableInsertBack(v))) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Same as $(D c.insertBack(v)), but guarantees no ranges will be invalidated.) ) $(TR $(TDNW $(D c.removeFront())) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Removes the element at the front of $(D c).) ) $(TR $(TDNW $(D c.stableRemoveFront())) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Same as $(D c.removeFront()), but guarantees no ranges will be invalidated.) ) $(TR $(TDNW $(D c.removeBack())) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Removes the value at the back of $(D c).) ) $(TR $(TDNW $(D c.stableRemoveBack())) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Same as $(D c.removeBack()), but guarantees no ranges will be invalidated.) ) $(TR $(TDNW $(D c.remove(r))) - $(TDNW $(D n$(SUBSCRIPT r) * log n$(SUBSCRIPT c))) + $(TDNW `n$(SUBSCRIPT r) * log n$(SUBSCRIPT c)`) $(TD Removes range $(D r) from $(D c).) ) $(TR $(TDNW $(D c.stableRemove(r))) - $(TDNW $(D n$(SUBSCRIPT r) * log n$(SUBSCRIPT c))) + $(TDNW `n$(SUBSCRIPT r) * log n$(SUBSCRIPT c)`) $(TD Same as $(D c.remove(r)), but guarantees iterators are not invalidated.) ) $(TR $(TDNW $(D c.linearRemove(r))) - $(TDNW $(D n$(SUBSCRIPT c))) + $(TDNW `n$(SUBSCRIPT c)`) $(TD Removes range $(D r) from $(D c).) ) $(TR $(TDNW $(D c.stableLinearRemove(r))) - $(TDNW $(D n$(SUBSCRIPT c))) + $(TDNW `n$(SUBSCRIPT c)`) $(TD Same as $(D c.linearRemove(r)), but guarantees iterators are not invalidated.) ) $(TR $(TDNW $(D c.removeKey(k))) - $(TDNW $(D log n$(SUBSCRIPT c))) + $(TDNW `log n$(SUBSCRIPT c)`) $(TD Removes an element from $(D c) by using its key $(D k). The key's type is defined by the _container.) ) @@ -707,9 +707,9 @@ Complexity: $(BIGOH log(n)). /** Ensures sufficient capacity to accommodate $(D n) elements. -Postcondition: $(D capacity >= n) +Postcondition: `capacity >= n` -Complexity: $(BIGOH log(e - capacity)) if $(D e > capacity), otherwise +Complexity: $(BIGOH log(e - capacity)) if `e > capacity`, otherwise $(BIGOH 1). */ void reserve(size_t e) @@ -804,7 +804,7 @@ Indexing operators yield or modify the value at a specified index. } /** -$(D k in container) returns true if the given key is in the container. +`k in container` returns true if the given key is in the container. */ bool opBinaryRight(string op)(KeyType k) if (op == "in") { @@ -860,7 +860,7 @@ stuff) } /** -Forwards to $(D insertAfter(this[], stuff)). +Forwards to `insertAfter(this[], stuff)`. */ void opOpAssign(string op)(Stuff stuff) if (op == "~") { @@ -888,7 +888,7 @@ unspecified positions in the container and initialized with $(D Complexity: $(BIGOH abs(n - newLength)) -Postcondition: $(D _length == newLength) +Postcondition: `_length == newLength` */ @property void length(size_t newLength) { @@ -994,7 +994,7 @@ Complexity: $(BIGOH log(n)). Removes the value at the front or back of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. The optional parameter $(D -howMany) instructs removal of that many elements. If $(D howMany > n), +howMany) instructs removal of that many elements. If `howMany > n`, all elements are removed and no exception is thrown. Precondition: $(D !empty) @@ -1025,7 +1025,7 @@ Complexity: $(BIGOH log(n)). Removes $(D howMany) values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove $(D howMany) elements. Instead, -if $(D howMany > n), all elements are removed. The returned value is +if `howMany > n`, all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. diff --git a/std/container/rbtree.d b/std/container/rbtree.d index deb4f246331..a1b959ace4f 100644 --- a/std/container/rbtree.d +++ b/std/container/rbtree.d @@ -721,13 +721,13 @@ private struct RBRange(N) * All inserts, removes, searches, and any function in general has complexity * of $(BIGOH lg(n)). * - * To use a different comparison than $(D "a < b"), pass a different operator string + * To use a different comparison than `"a < b"`, pass a different operator string * that can be used by $(REF binaryFun, std,functional), or pass in a - * function, delegate, functor, or any type where $(D less(a, b)) results in a $(D bool) + * function, delegate, functor, or any type where `less(a, b)` results in a `bool` * value. * * Note that less should produce a strict ordering. That is, for two unequal - * elements $(D a) and $(D b), $(D less(a, b) == !less(b, a)). $(D less(a, a)) should + * elements `a` and `b`, `less(a, b) == !less(b, a)`. `less(a, a)` should * always equal $(D false). * * If $(D allowDuplicates) is set to $(D true), then inserting the same element more than diff --git a/std/container/slist.d b/std/container/slist.d index a3c0d52eb8c..dff5cb4c150 100644 --- a/std/container/slist.d +++ b/std/container/slist.d @@ -424,7 +424,7 @@ Complexity: $(BIGOH 1). Removes $(D howMany) values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove $(D howMany) elements. Instead, -if $(D howMany > n), all elements are removed. The returned value is +if `howMany > n`, all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. @@ -495,10 +495,10 @@ assert(std.algorithm.equal(sl[], ["a", "b", "c", "d", "e"])); Similar to $(D insertAfter) above, but accepts a range bounded in count. This is important for ensuring fast insertions in the middle of the list. For fast insertions after a specified position $(D r), use -$(D insertAfter(take(r, 1), stuff)). The complexity of that operation +`insertAfter(take(r, 1), stuff)`. The complexity of that operation only depends on the number of elements in $(D stuff). -Precondition: $(D r.original.empty || r.maxLength > 0) +Precondition: `r.original.empty || r.maxLength > 0` Returns: The number of values inserted. diff --git a/std/conv.d b/std/conv.d index 00b2e2a35fe..2dd363f7e5c 100644 --- a/std/conv.d +++ b/std/conv.d @@ -587,7 +587,7 @@ if (!isImplicitlyConvertible!(S, T) && /** When target type supports 'converting construction', it is used. $(UL $(LI If target type is struct, $(D T(value)) is used.) - $(LI If target type is class, $(D new T(value)) is used.)) + $(LI If target type is class, `new T(value)` is used.)) */ private T toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) && diff --git a/std/datetime.d b/std/datetime.d index be9ac8eaf07..e7d9b437292 100644 --- a/std/datetime.d +++ b/std/datetime.d @@ -68,7 +68,7 @@ auto restoredTime = SysTime.fromISOExtString(timeString); -------------------- Various functions take a string (or strings) to represent a unit of time - (e.g. $(D convert!("days", "hours")(numDays))). The valid strings to use + (e.g. `convert!("days", "hours")(numDays)`). The valid strings to use with such functions are $(D "years"), $(D "months"), $(D "weeks"), $(D "days"), $(D "hours"), $(D "minutes"), $(D "seconds"), $(D "msecs") (milliseconds), $(D "usecs") (microseconds), @@ -13358,7 +13358,7 @@ private: current year. $(D _addDays(numDays)) is effectively equivalent to - $(D date.dayOfGregorianCal = date.dayOfGregorianCal + days). + `date.dayOfGregorianCal = date.dayOfGregorianCal + days`. Params: days = The number of days to add to this Date. @@ -18506,7 +18506,7 @@ assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).length == /++ - Whether the interval's length is 0, that is, whether $(D begin == end). + Whether the interval's length is 0, that is, whether `begin == end`. Example: -------------------- @@ -19329,8 +19329,8 @@ assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span( /++ Shifts the interval forward or backwards in time by the given duration (a positive duration shifts the interval forward; a negative duration - shifts it backward). Effectively, it does $(D begin += duration) and - $(D end += duration). + shifts it backward). Effectively, it does `begin += duration` and + `end += duration`. Params: duration = The duration to shift the interval by. @@ -19424,7 +19424,7 @@ assert(interval2 == Interval!Date(Date(1994, 1, 2), Date(2010, 3, 1))); /++ Expands the interval forwards and/or backwards in time. Effectively, - it does $(D begin -= duration) and/or $(D end += duration). Whether + it does `begin -= duration` and/or `end += duration`. Whether it expands forwards and/or backwards in time is determined by $(D_PARAM dir). @@ -22259,7 +22259,7 @@ assert(PosInfInterval!Date(Date(1996, 1, 2)).span( Shifts the $(D begin) of this interval forward or backwards in time by the given duration (a positive duration shifts the interval forward; a negative duration shifts it backward). Effectively, it does - $(D begin += duration). + `begin += duration`. Params: duration = The duration to shift the interval by. @@ -22332,7 +22332,7 @@ assert(interval2 == PosInfInterval!Date(Date(1995, 11, 13))); /++ Expands the interval backwards in time. Effectively, it does - $(D begin -= duration). + `begin -= duration`. Params: duration = The duration to expand the interval by. @@ -24490,7 +24490,7 @@ assert(NegInfInterval!Date(Date(2012, 3, 1)).span( Shifts the $(D end) of this interval forward or backwards in time by the given duration (a positive duration shifts the interval forward; a negative duration shifts it backward). Effectively, it does - $(D end += duration). + `end += duration`. Params: duration = The duration to shift the interval by. @@ -24562,7 +24562,7 @@ assert(interval2 == NegInfInterval!Date(Date(2010, 3, 1))); /++ Expands the interval forwards in time. Effectively, it does - $(D end += duration). + `end += duration`. Params: duration = The duration to expand the interval by. @@ -26429,10 +26429,10 @@ if (isTimePoint!TP && day later. That function would then be used by $(D IntervalRange)'s $(D popFront) to iterate over the $(LREF Date)s in the interval. - If $(D dir == Direction.fwd), then a range iterates forward in time, whereas - if $(D dir == Direction.bwd), then it iterates backwards in time. So, if - $(D dir == Direction.fwd) then $(D front == interval.begin), whereas if - $(D dir == Direction.bwd) then $(D front == interval.end). $(D func) must + If `dir == Direction.fwd`, then a range iterates forward in time, whereas + if `dir == Direction.bwd`, then it iterates backwards in time. So, if + `dir == Direction.fwd` then `front == interval.begin`, whereas if + `dir == Direction.bwd` then `front == interval.end`. `func` must generate a time point going in the proper direction of iteration, or a $(LREF DateTimeException) will be thrown. So, to iterate forward in time, the time point that $(D func) generates must be later in time than the @@ -26448,13 +26448,13 @@ if (isTimePoint!TP && $(D begin). In either case, the range would then be empty. Also note that while normally the $(D begin) of an interval is included in - it and its $(D end) is excluded from it, if $(D dir == Direction.bwd), then + it and its `end` is excluded from it, if `dir == Direction.bwd`, then $(D begin) is treated as excluded and $(D end) is treated as included. This allows for the same behavior in both directions. This works because none of $(LREF2 .Interval, Interval)'s functions which care about whether $(D begin) or $(D end) is included or excluded are ever called by $(D IntervalRange). $(D interval) - returns a normal interval, regardless of whether $(D dir == Direction.fwd) - or if $(D dir == Direction.bwd), so any $(LREF2 .Interval, Interval) functions which are + returns a normal interval, regardless of whether `dir == Direction.fwd` + or if `dir == Direction.bwd`, so any $(LREF2 .Interval, Interval) functions which are called on it which care about whether $(D begin) or $(D end) are included or excluded will treat $(D begin) as included and $(D end) as excluded. +/ @@ -32128,7 +32128,7 @@ ComparingBenchmarkResult comparingBenchmark(alias baseFunc, accepts $(REF Duration, core,time) and returns $(D Unqual!T). 4. $(D T) must define an $(D opOpAssign) for addition and subtraction that - accepts $(REF Duration, core,time) and returns $(D ref Unqual!T). + accepts $(REF Duration, core,time) and returns `ref Unqual!T`. 5. $(D T) must define a $(D opBinary) for subtraction which accepts $(D T) and returns returns $(REF Duration, core,time). @@ -33807,7 +33807,7 @@ if (units == "months" || thrown. Throws: - $(LREF DateTimeException) if $(D valid!"days"(year, month, day)) is false. + $(LREF DateTimeException) if `valid!"days"(year, month, day)` is false. +/ void enforceValid(string units) (int year, Month month, int day, string file = __FILE__, size_t line = __LINE__) @safe pure diff --git a/std/digest/crc.d b/std/digest/crc.d index 25ec75c9c96..c1dee53cf68 100644 --- a/std/digest/crc.d +++ b/std/digest/crc.d @@ -385,7 +385,7 @@ public alias crcHexString = toHexString!(Order.decreasing, 16); * OOP API CRC32 implementation. * See $(D std.digest.digest) for differences between template and OOP API. * - * This is an alias for $(D $(REF WrapperDigest, std,digest,digest)!CRC32), see + * This is an alias for `$(REF WrapperDigest, std,digest,digest)!CRC32`, see * there for more information. */ alias CRC32Digest = WrapperDigest!CRC32; diff --git a/std/digest/md.d b/std/digest/md.d index 8ef7bbcb583..91554e9cf83 100644 --- a/std/digest/md.d +++ b/std/digest/md.d @@ -513,7 +513,7 @@ auto md5Of(T...)(T data) * OOP API MD5 implementation. * See $(D std.digest.digest) for differences between template and OOP API. * - * This is an alias for $(D $(REF WrapperDigest, std,digest,digest)!MD5), see + * This is an alias for `$(REF WrapperDigest, std,digest,digest)!MD5`, see * there for more information. */ alias MD5Digest = WrapperDigest!MD5; diff --git a/std/digest/murmurhash.d b/std/digest/murmurhash.d index 89b4b1cd476..5013b7e7b4f 100644 --- a/std/digest/murmurhash.d +++ b/std/digest/murmurhash.d @@ -10,13 +10,13 @@ The older MurmurHash 1 and 2 are currently not supported. MurmurHash3 comes in three flavors, listed in increasing order of throughput: $(UL $(LI $(D MurmurHash3!32) produces a 32-bit value and is optimized for 32-bit architectures) -$(LI $(D MurmurHash3!(128, 32)) produces a 128-bit value and is optimized for 32-bit architectures) -$(LI $(D MurmurHash3!(128, 64)) produces a 128-bit value and is optimized for 64-bit architectures) +$(LI `MurmurHash3!(128, 32)` produces a 128-bit value and is optimized for 32-bit architectures) +$(LI `MurmurHash3!(128, 64)` produces a 128-bit value and is optimized for 64-bit architectures) ) Note: $(UL -$(LI $(D MurmurHash3!(128, 32)) and $(D MurmurHash3!(128, 64)) produce different values.) +$(LI `MurmurHash3!(128, 32)` and `MurmurHash3!(128, 64)` produce different values.) $(LI The current implementation is optimized for little endian architectures. It will exhibit different results on big endian architectures and a slightly less uniform distribution.) diff --git a/std/digest/ripemd.d b/std/digest/ripemd.d index 0dd472c03e4..4ba922318f3 100644 --- a/std/digest/ripemd.d +++ b/std/digest/ripemd.d @@ -682,7 +682,7 @@ auto ripemd160Of(T...)(T data) * OOP API RIPEMD160 implementation. * See $(D std.digest.digest) for differences between template and OOP API. * - * This is an alias for $(D $(REF WrapperDigest, std,digest,digest)!RIPEMD160), + * This is an alias for `$(REF WrapperDigest, std,digest,digest)!RIPEMD160`, * see there for more information. */ alias RIPEMD160Digest = WrapperDigest!RIPEMD160; diff --git a/std/digest/sha.d b/std/digest/sha.d index 5494e7b3186..220ba0734ad 100644 --- a/std/digest/sha.d +++ b/std/digest/sha.d @@ -1201,7 +1201,7 @@ auto sha512_256Of(T...)(T data) * OOP API SHA1 and SHA2 implementations. * See $(D std.digest.digest) for differences between template and OOP API. * - * This is an alias for $(D $(REF WrapperDigest, std,digest,digest)!SHA1), see + * This is an alias for `$(REF WrapperDigest, std,digest,digest)!SHA1`, see * there for more information. */ alias SHA1Digest = WrapperDigest!SHA1; diff --git a/std/exception.d b/std/exception.d index ef654f32c97..e08ce148b53 100644 --- a/std/exception.d +++ b/std/exception.d @@ -334,7 +334,7 @@ void assertThrown(T : Throwable = Exception, E) line = The line number of the caller. Returns: $(D value), if `cast(bool) value` is true. Otherwise, - $(D new Exception(msg)) is thrown. + `new Exception(msg)` is thrown. Note: $(D enforce) is used to throw exceptions and is therefore intended to @@ -542,7 +542,7 @@ T enforce(T)(T value, lazy Throwable ex) msg = The message to include in the `ErrnoException` if it is thrown. Returns: $(D value), if `cast(bool) value` is true. Otherwise, - $(D new ErrnoException(msg)) is thrown. It is assumed that the last + `new ErrnoException(msg)` is thrown. It is assumed that the last operation set $(D errno) to an error code corresponding with the failed condition. @@ -563,9 +563,9 @@ T errnoEnforce(T, string file = __FILE__, size_t line = __LINE__) /++ If $(D !value) is $(D false), $(D value) is returned. Otherwise, - $(D new E(msg, file, line)) is thrown. Or if $(D E) doesn't take a message - and can be constructed with $(D new E(file, line)), then - $(D new E(file, line)) will be thrown. + `new E(msg, file, line)` is thrown. Or if `E` doesn't take a message + and can be constructed with `new E(file, line)`, then + `new E(file, line)` will be thrown. This is legacy name, it is recommended to use $(D enforce!E) instead. @@ -1025,7 +1025,7 @@ $(D source) does not point to $(D target). It may produce false positives, but n false negatives. This function should be prefered for defensively choosing a code path. -Note: Evaluating $(D doesPointTo(x, x)) checks whether $(D x) has +Note: Evaluating `doesPointTo(x, x)` checks whether `x` has internal pointers. This should only be done as an assertive test, as the language is free to assume objects don't have internal pointers (TDPL 7.1.3.5). @@ -1741,7 +1741,7 @@ Params: primitivesToHandle = Set of range primitives to _handle. handler = The callable that is called when a handled primitive throws a $(D Throwable) of type $(D E). The handler must accept arguments of - the form $(D E, ref IRange) and its return value is used as the primitive's + the form `E, ref IRange` and its return value is used as the primitive's return value whenever $(D E) is thrown. For $(D opIndex), the handler can optionally recieve a third argument; the index that caused the exception. input = The range to _handle. diff --git a/std/experimental/allocator/building_blocks/bitmapped_block.d b/std/experimental/allocator/building_blocks/bitmapped_block.d index e9c9e0846f1..c17b36396cf 100644 --- a/std/experimental/allocator/building_blocks/bitmapped_block.d +++ b/std/experimental/allocator/building_blocks/bitmapped_block.d @@ -37,8 +37,8 @@ both internal and external fragmentation. The size of each block can be selected either during compilation or at run time. Statically-known block sizes are frequent in practice and yield slightly better performance. To choose a block size statically, pass it as the $(D -blockSize) parameter as in $(D BitmappedBlock!(Allocator, 4096)). To choose a block -size parameter, use $(D BitmappedBlock!(Allocator, chooseAtRuntime)) and pass the +blockSize) parameter as in `BitmappedBlock!(Allocator, 4096)`. To choose a block +size parameter, use `BitmappedBlock!(Allocator, chooseAtRuntime)` and pass the block size to the constructor. */ @@ -65,7 +65,7 @@ struct BitmappedBlock(size_t theBlockSize, uint theAlignment = platformAlignment "Block size must be a multiple of the alignment"); /** - If $(D blockSize == chooseAtRuntime), $(D BitmappedBlock) offers a read/write + If `blockSize == chooseAtRuntime`, `BitmappedBlock` offers a read/write property $(D blockSize). It must be set before any use of the allocator. Otherwise (i.e. $(D theBlockSize) is a legit constant), $(D blockSize) is an alias for $(D theBlockSize). Whether constant or variable, must also be @@ -298,7 +298,7 @@ struct BitmappedBlock(size_t theBlockSize, uint theAlignment = platformAlignment /** Allocates a block with specified alignment $(D a). The alignment must be a - power of 2. If $(D a <= alignment), function forwards to $(D allocate). + power of 2. If `a <= alignment`, function forwards to `allocate`. Otherwise, it attempts to overallocate and then adjust the result for proper alignment. In the worst case the slack memory is around two blocks. */ diff --git a/std/experimental/allocator/building_blocks/bucketizer.d b/std/experimental/allocator/building_blocks/bucketizer.d index ea802abbc42..a1bd2269799 100644 --- a/std/experimental/allocator/building_blocks/bucketizer.d +++ b/std/experimental/allocator/building_blocks/bucketizer.d @@ -4,11 +4,11 @@ module std.experimental.allocator.building_blocks.bucketizer; /** A $(D Bucketizer) uses distinct allocators for handling allocations of sizes in -the intervals $(D [min, min + step - 1]), $(D [min + step, min + 2 * step - 1]), -$(D [min + 2 * step, min + 3 * step - 1]), $(D ...), $(D [max - step + 1, max]). +the intervals `[min, min + step - 1]`, `[min + step, min + 2 * step - 1]`, +`[min + 2 * step, min + 3 * step - 1]`, `...`, `[max - step + 1, max]`. $(D Bucketizer) holds a fixed-size array of allocators and dispatches calls to -them appropriately. The size of the array is $(D (max + 1 - min) / step), which +them appropriately. The size of the array is `(max + 1 - min) / step`, which must be an exact division. Allocations for sizes smaller than $(D min) or larger than $(D max) are illegal @@ -87,8 +87,8 @@ struct Bucketizer(Allocator, size_t min, size_t max, size_t step) /** This method allows expansion within the respective bucket range. It succeeds - if both $(D b.length) and $(D b.length + delta) fall in a range of the form - $(D [min + k * step, min + (k + 1) * step - 1]). + if both `b.length` and `b.length + delta` fall in a range of the form + `[min + k * step, min + (k + 1) * step - 1]`. */ bool expand(ref void[] b, size_t delta) { diff --git a/std/experimental/allocator/building_blocks/fallback_allocator.d b/std/experimental/allocator/building_blocks/fallback_allocator.d index b24525241aa..c83a4705287 100644 --- a/std/experimental/allocator/building_blocks/fallback_allocator.d +++ b/std/experimental/allocator/building_blocks/fallback_allocator.d @@ -246,7 +246,7 @@ struct FallbackAllocator(Primary, Fallback) /** $(D empty) is defined if both allocators also define it. - Returns: $(D primary.empty & fallback.empty) + Returns: `primary.empty & fallback.empty` */ static if (hasMember!(Primary, "empty") && hasMember!(Fallback, "empty")) Ternary empty() diff --git a/std/experimental/allocator/building_blocks/free_list.d b/std/experimental/allocator/building_blocks/free_list.d index a11d9b808d1..53a776280f1 100644 --- a/std/experimental/allocator/building_blocks/free_list.d +++ b/std/experimental/allocator/building_blocks/free_list.d @@ -13,7 +13,7 @@ deallocated in the past. All other allocations are directed to $(D ParentAllocator). Due to the simplicity of free list management, allocations from the free list are fast. -One instantiation is of particular interest: $(D FreeList!(0, unbounded)) puts +One instantiation is of particular interest: `FreeList!(0, unbounded)` puts every deallocation in the freelist, and subsequently serves any allocation from the freelist (if not empty). There is no checking of size matching, which would be incorrect for a freestanding allocator but is both correct and fast when an @@ -46,7 +46,7 @@ struct FreeList(ParentAllocator, { /** Returns the smallest allocation size eligible for allocation from the - freelist. (If $(D minSize != chooseAtRuntime), this is simply an alias + freelist. (If `minSize != chooseAtRuntime`, this is simply an alias for $(D minSize).) */ @property size_t min() const @@ -62,11 +62,11 @@ struct FreeList(ParentAllocator, Params: low = new value for $(D min) - Precondition: $(D low <= max), or $(D maxSize == chooseAtRuntime) and + Precondition: `low <= max`, or `maxSize == chooseAtRuntime` and $(D max) has not yet been initialized. Also, no allocation has been yet done with this allocator. - Postcondition: $(D min == low) + Postcondition: `min == low` */ @property void min(size_t low) { @@ -84,7 +84,7 @@ struct FreeList(ParentAllocator, { /** Returns the largest allocation size eligible for allocation from the - freelist. (If $(D maxSize != chooseAtRuntime), this is simply an alias + freelist. (If `maxSize != chooseAtRuntime`, this is simply an alias for $(D maxSize).) All allocation requests for sizes greater than or equal to $(D min) and less than or equal to $(D max) are rounded to $(D max) and forwarded to the parent allocator. When the block fitting the @@ -101,10 +101,10 @@ struct FreeList(ParentAllocator, Params: high = new value for $(D max) - Precondition: $(D high >= min), or $(D minSize == chooseAtRuntime) and - $(D min) has not yet been initialized. Also $(D high >= (void*).sizeof). Also, no allocation has been yet done with this allocator. + Precondition: `high >= min`, or `minSize == chooseAtRuntime` and + `min` has not yet been initialized. Also `high >= (void*).sizeof`. Also, no allocation has been yet done with this allocator. - Postcondition: $(D max == high) + Postcondition: `max == high` */ @property void max(size_t high) { @@ -225,8 +225,8 @@ struct FreeList(ParentAllocator, alias alignment = ParentAllocator.alignment; /** - If $(D maxSize == unbounded), returns $(D parent.goodAllocSize(bytes)). - Otherwise, returns $(D max) for sizes in the interval $(D [min, max]), and + If `maxSize == unbounded`, returns `parent.goodAllocSize(bytes)`. + Otherwise, returns `max` for sizes in the interval `[min, max]`, and $(D parent.goodAllocSize(bytes)) otherwise. Precondition: @@ -234,7 +234,7 @@ struct FreeList(ParentAllocator, appropriately. Postcondition: - $(D result >= bytes) + `result >= bytes` */ size_t goodAllocSize(size_t bytes) { @@ -287,8 +287,8 @@ struct FreeList(ParentAllocator, /** Allocates memory either off of the free list or from the parent allocator. - If $(D n) is within $(D [min, max]) or if the free list is unchecked - ($(D minSize == 0 && maxSize == size_t.max)), then the free list is + If `n` is within `[min, max]` or if the free list is unchecked + (`minSize == 0 && maxSize == size_t.max`), then the free list is consulted first. If not empty (hit), the block at the front of the free list is removed from the list and returned. Otherwise (miss), a new block of $(D max) bytes is allocated, truncated to $(D n) bytes, and returned. @@ -303,7 +303,7 @@ struct FreeList(ParentAllocator, If set at runtime, $(D min) and/or $(D max) must be initialized appropriately. - Postcondition: $(D result.length == bytes || result is null) + Postcondition: `result.length == bytes || result is null` */ void[] allocate(size_t n) { @@ -327,8 +327,8 @@ struct FreeList(ParentAllocator, "expand", "owns", "reallocate")); /** - If $(D block.length) is within $(D [min, max]) or if the free list is - unchecked ($(D minSize == 0 && maxSize == size_t.max)), then inserts the + If `block.length` is within `[min, max]` or if the free list is + unchecked (`minSize == 0 && maxSize == size_t.max`), then inserts the block at the front of the free list. For all others, forwards to $(D parent.deallocate) if $(D Parent.deallocate) is defined. @@ -420,7 +420,7 @@ lived objects may occupy the entire block, making it unavailable for serving allocations from the free list. However, an absolute cap on the free list size may be beneficial. -The options $(D minSize == unbounded) and $(D maxSize == unbounded) are not +The options `minSize == unbounded` and `maxSize == unbounded` are not available for $(D ContiguousFreeList). */ struct ContiguousFreeList(ParentAllocator, @@ -489,10 +489,10 @@ struct ContiguousFreeList(ParentAllocator, bytes = Bytes (not items) to be allocated for the free list. Memory will be allocated during construction and deallocated in the destructor. max = Maximum size eligible for freelisting. Construction with this - parameter is defined only if $(D maxSize == chooseAtRuntime) or $(D maxSize + parameter is defined only if `maxSize == chooseAtRuntime` or `maxSize == unbounded). min = Minimum size eligible for freelisting. Construction with this - parameter is defined only if $(D minSize == chooseAtRuntime). If this + parameter is defined only if `minSize == chooseAtRuntime`. If this condition is met and no $(D min) parameter is present, $(D min) is initialized with $(D max). */ @@ -581,7 +581,7 @@ struct ContiguousFreeList(ParentAllocator, appropriately. Postcondition: - $(D result >= bytes) + `result >= bytes` */ size_t goodAllocSize(size_t n) { diff --git a/std/experimental/allocator/building_blocks/free_tree.d b/std/experimental/allocator/building_blocks/free_tree.d index 6b64659297e..62aacbacec0 100644 --- a/std/experimental/allocator/building_blocks/free_tree.d +++ b/std/experimental/allocator/building_blocks/free_tree.d @@ -40,7 +40,7 @@ blocks are rotated to the root of the tree. That way allocations are cache friendly and also frequently used sizes are more likely to be found quickly, whereas seldom used sizes migrate to the leaves of the tree. -$(D FreeTree) rounds up small allocations to at least $(D 4 * size_t.sizeof), +`FreeTree` rounds up small allocations to at least `4 * size_t.sizeof`, which on 64-bit system is one cache line size. If very small objects need to be efficiently allocated, the $(D FreeTree) should be fronted with an appropriate small object allocator. @@ -260,7 +260,7 @@ struct FreeTree(ParentAllocator) } /** - Returns $(D parent.goodAllocSize(max(Node.sizeof, s))). + Returns `parent.goodAllocSize(max(Node.sizeof, s))`. */ static if (stateSize!ParentAllocator) size_t goodAllocSize(size_t s) diff --git a/std/experimental/allocator/building_blocks/null_allocator.d b/std/experimental/allocator/building_blocks/null_allocator.d index 06bad01f1d4..24c0dcc8334 100644 --- a/std/experimental/allocator/building_blocks/null_allocator.d +++ b/std/experimental/allocator/building_blocks/null_allocator.d @@ -27,7 +27,7 @@ struct NullAllocator void[] allocateAll() shared { return null; } /** These methods return $(D false). - Precondition: $(D b is null). This is because there is no other possible + Precondition: `b is null`. This is because there is no other possible legitimate input. */ bool expand(ref void[] b, size_t s) shared @@ -46,7 +46,7 @@ struct NullAllocator void[] resolveInternalPointer(void*) shared const { return null; } /** No-op. - Precondition: $(D b is null) + Precondition: `b is null` */ bool deallocate(void[] b) shared { assert(b is null); return true; } /** diff --git a/std/experimental/allocator/building_blocks/package.d b/std/experimental/allocator/building_blocks/package.d index 624e6fb0912..31d68e74832 100644 --- a/std/experimental/allocator/building_blocks/package.d +++ b/std/experimental/allocator/building_blocks/package.d @@ -49,7 +49,7 @@ implementation that returns $(D n) rounded up to a multiple of the allocator's alignment.)) $(TR $(TDC void[] allocate(size_t s);, $(POST $(RES) is null || $(RES).length == -s)) $(TD If $(D s == 0), the call may return any empty slice (including $(D +s)) $(TD If `s == 0`, the call may return any empty slice (including $(D null)). Otherwise, the call allocates $(D s) bytes of memory and returns the allocated block, or $(D null) if the request could not be satisfied.)) @@ -70,10 +70,10 @@ reallocated or deallocated with the usual primitives, if defined).)) $(TR $(TDC bool expand(ref void[] b, size_t delta);, $(POST !$(RES) || b.length == $(I old)(b).length + delta)) $(TD Expands $(D b) by $(D delta) bytes. If $(D -delta == 0), succeeds without changing $(D b). If $(D b is null), returns +delta == 0), succeeds without changing `b`. If `b is null`, returns `false` (the null pointer cannot be expanded in place). Otherwise, $(D b) must be a buffer previously allocated with the same allocator. If expansion -was successful, $(D expand) changes $(D b)'s length to $(D b.length + delta) and +was successful, `expand` changes `b`'s length to `b.length + delta` and returns $(D true). Upon failure, the call effects no change upon the allocator object, leaves $(D b) unchanged, and returns $(D false).)) @@ -100,7 +100,7 @@ $(TR $(TDC Ternary owns(void[] b);) $(TD Returns `Ternary.yes` if `b` has been allocated with this allocator. An allocator should define this method only if it can decide on ownership precisely and fast (in constant time, logarithmic time, or linear time with a low multiplication factor). Traditional allocators such as -the C heap do not define such functionality. If $(D b is null), the allocator +the C heap do not define such functionality. If `b is null`, the allocator shall return `Ternary.no`, i.e. no allocator owns the `null` slice.)) $(TR $(TDC void[] resolveInternalPointer(void* p);) $(TD If $(D p) is a pointer @@ -109,7 +109,7 @@ beginning of the allocated block. Otherwise, returns $(D null). If the pointer points immediately after an allocated block, the result is implementation defined.)) -$(TR $(TDC bool deallocate(void[] b);) $(TD If $(D b is null), does +$(TR $(TDC bool deallocate(void[] b);) $(TD If `b is null`, does nothing and returns `true`. Otherwise, deallocates memory previously allocated with this allocator and returns `true` if successful, `false` otherwise. An implementation that would not support deallocation (i.e. would always return @@ -176,7 +176,7 @@ across threads, and to deallocate blocks in a different thread than the one that allocated it. All allocators in this module accept and return $(D void[]) (as opposed to -$(D shared void[])). This is because at the time of allocation, deallocation, or +`shared void[]`). This is because at the time of allocation, deallocation, or reallocation, the memory is effectively not $(D shared) (if it were, it would reveal a bug at the application level). @@ -252,10 +252,10 @@ simple bump-the-pointer allocator.)) $(TR $(TDC2 InSituRegion, region) $(TD Region holding its own allocation, most often on the stack. Has statically-determined size.)) -$(TR $(TDC2 SbrkRegion, region) $(TD Region using $(D $(LUCKY sbrk)) for allocating +$(TR $(TDC2 SbrkRegion, region) $(TD Region using `$(LUCKY sbrk)` for allocating memory.)) -$(TR $(TDC3 MmapAllocator, mmap_allocator) $(TD Allocator using $(D $(LUCKY mmap)) directly.)) +$(TR $(TDC3 MmapAllocator, mmap_allocator) $(TD Allocator using `$(LUCKY mmap)` directly.)) $(TR $(TDC2 StatsCollector, stats_collector) $(TD Collect statistics about any other allocator.)) @@ -282,9 +282,9 @@ Macros: MYREF2 = $(REF_SHORT $1, std,experimental,allocator,building_blocks,$2) MYREF3 = $(REF_SHORT $1, std,experimental,allocator,$2) TDC = $(TDNW $(D $1)$+) -TDC2 = $(TDNW $(D $(MYREF2 $1,$+))$(BR)$(SMALL +TDC2 = $(TDNW `$(MYREF2 $1,$+)`$(BR)$(SMALL $(D std.experimental.allocator.building_blocks.$2))) -TDC3 = $(TDNW $(D $(MYREF3 $1,$+))$(BR)$(SMALL +TDC3 = $(TDNW `$(MYREF3 $1,$+)`$(BR)$(SMALL $(D std.experimental.allocator.$2))) RES = $(I result) POST = $(BR)$(SMALL $(I Post:) $(BLUE $(D $0))) diff --git a/std/experimental/allocator/building_blocks/quantizer.d b/std/experimental/allocator/building_blocks/quantizer.d index 38a061d7454..446e33d1764 100644 --- a/std/experimental/allocator/building_blocks/quantizer.d +++ b/std/experimental/allocator/building_blocks/quantizer.d @@ -29,7 +29,7 @@ not enforced (save for the use of $(D assert)) for the sake of efficiency. $(OL $(LI $(D roundingFunction(n) >= n) for all $(D n) of type $(D size_t);) $(LI $(D roundingFunction) must be monotonically increasing, i.e. $(D -roundingFunction(n1) <= roundingFunction(n2)) for all $(D n1 < n2);) +roundingFunction(n1) <= roundingFunction(n2)) for all `n1 < n2`;) $(LI $(D roundingFunction) must be $(D pure), i.e. always return the same value for a given $(D n).) ) @@ -71,7 +71,7 @@ struct Quantizer(ParentAllocator, alias roundingFunction) /** Gets a larger buffer $(D buf) by calling $(D parent.allocate(goodAllocSize(n))). If $(D buf) is $(D null), returns - $(D null). Otherwise, returns $(D buf[0 .. n]). + `null`. Otherwise, returns `buf[0 .. n]`. */ void[] allocate(size_t n) { @@ -93,7 +93,7 @@ struct Quantizer(ParentAllocator, alias roundingFunction) /** First checks whether there's enough slack memory preallocated for $(D b) - by evaluating $(D b.length + delta <= goodAllocSize(b.length)). If that's + by evaluating `b.length + delta <= goodAllocSize(b.length)`. If that's the case, expands $(D b) in place. Otherwise, attempts to use $(D parent.expand) appropriately if present. */ @@ -194,7 +194,7 @@ struct Quantizer(ParentAllocator, alias roundingFunction) /** Defined if $(D ParentAllocator.deallocate) exists and forwards to - $(D parent.deallocate(b.ptr[0 .. goodAllocSize(b.length)])). + `parent.deallocate(b.ptr[0 .. goodAllocSize(b.length)])`. */ static if (hasMember!(ParentAllocator, "deallocate")) bool deallocate(void[] b) diff --git a/std/experimental/allocator/building_blocks/region.d b/std/experimental/allocator/building_blocks/region.d index 56192dc8322..93758a914d4 100644 --- a/std/experimental/allocator/building_blocks/region.d +++ b/std/experimental/allocator/building_blocks/region.d @@ -20,9 +20,9 @@ against the limit. If $(D ParentAllocator) is different from $(D NullAllocator), $(D Region) deallocates the chunk of memory during destruction. -The $(D minAlign) parameter establishes alignment. If $(D minAlign > 1), the +The `minAlign` parameter establishes alignment. If `minAlign > 1`, the sizes of all allocation requests are rounded up to a multiple of $(D minAlign). -Applications aiming at maximum speed may want to choose $(D minAlign = 1) and +Applications aiming at maximum speed may want to choose `minAlign = 1` and control alignment externally. */ @@ -112,7 +112,7 @@ struct Region(ParentAllocator = NullAllocator, /** Allocates $(D n) bytes of memory. The shortest path involves an alignment - adjustment (if $(D alignment > 1)), an increment, and a comparison. + adjustment (if `alignment > 1`), an increment, and a comparison. Params: n = number of bytes to allocate @@ -366,7 +366,7 @@ The first template argument is the size of the region and the second is the needed alignment. Depending on the alignment requested and platform details, the actual available storage may be smaller than the compile-time parameter. To make sure that at least $(D n) bytes are available in the region, use -$(D InSituRegion!(n + a - 1, a)). +`InSituRegion!(n + a - 1, a)`. Given that the most frequent use of `InSituRegion` is as a stack allocator, it allocates starting at the end on systems where stack grows downwards, such that @@ -429,7 +429,7 @@ struct InSituRegion(size_t size, size_t minAlign = platformAlignment) /** Allocates $(D bytes) and returns them, or $(D null) if the region cannot - accommodate the request. For efficiency reasons, if $(D bytes == 0) the + accommodate the request. For efficiency reasons, if `bytes == 0` the function returns an empty non-null slice. */ void[] allocate(size_t n) @@ -581,7 +581,7 @@ private extern(C) int brk(shared void*); /** -Allocator backed by $(D $(LUCKY sbrk)) for Posix systems. Due to the fact that +Allocator backed by `$(LUCKY sbrk)` for Posix systems. Due to the fact that $(D sbrk) is not thread-safe $(HTTP lifecs.likai.org/2010/02/sbrk-is-not-thread- safe.html, by design), $(D SbrkRegion) uses a mutex internally. This implies that uncontrolled calls to $(D brk) and $(D sbrk) may affect the workings of $(D diff --git a/std/experimental/allocator/building_blocks/scoped_allocator.d b/std/experimental/allocator/building_blocks/scoped_allocator.d index 998a05f2894..7f4c8307669 100644 --- a/std/experimental/allocator/building_blocks/scoped_allocator.d +++ b/std/experimental/allocator/building_blocks/scoped_allocator.d @@ -96,7 +96,7 @@ struct ScopedAllocator(ParentAllocator) } /** - Forwards to $(D parent.expand(b, delta)). + Forwards to `parent.expand(b, delta)`. */ static if (hasMember!(Allocator, "expand")) bool expand(ref void[] b, size_t delta) diff --git a/std/experimental/allocator/building_blocks/segregator.d b/std/experimental/allocator/building_blocks/segregator.d index 3d31c4be1f0..c693339480b 100644 --- a/std/experimental/allocator/building_blocks/segregator.d +++ b/std/experimental/allocator/building_blocks/segregator.d @@ -38,7 +38,7 @@ struct Segregator(size_t threshold, SmallAllocator, LargeAllocator) */ static size_t goodAllocSize(size_t s); /** - The memory is obtained from $(D SmallAllocator) if $(D s <= threshold), + The memory is obtained from `SmallAllocator` if `s <= threshold`, or $(D LargeAllocator) otherwise. */ void[] allocate(size_t); @@ -51,7 +51,7 @@ struct Segregator(size_t threshold, SmallAllocator, LargeAllocator) This method is defined only if at least one of the allocators defines it. If $(D SmallAllocator) defines $(D expand) and $(D b.length + delta <= threshold), the call is forwarded to $(D SmallAllocator). If $( - LargeAllocator) defines $(D expand) and $(D b.length > threshold), the + LargeAllocator) defines `expand` and `b.length > threshold`, the call is forwarded to $(D LargeAllocator). Otherwise, the call returns $(D false). */ @@ -72,7 +72,7 @@ struct Segregator(size_t threshold, SmallAllocator, LargeAllocator) bool alignedReallocate(ref void[] b, size_t s); /** This method is defined only if both allocators define it. The call is - forwarded to $(D SmallAllocator) if $(D b.length <= threshold), or $(D + forwarded to `SmallAllocator` if `b.length <= threshold`, or $(D LargeAllocator) otherwise. */ Ternary owns(void[] b); @@ -310,8 +310,8 @@ alias A = ---- With this definition, allocation requests for $(D n1) bytes or less are directed -to $(D A1); requests between $(D n1 + 1) and $(D n2) bytes (inclusive) are -directed to $(D A2); requests between $(D n2 + 1) and $(D n3) bytes (inclusive) +to `A1`; requests between `n1 + 1` and `n2` bytes (inclusive) are +directed to `A2`; requests between `n2 + 1` and `n3` bytes (inclusive) are directed to $(D A3); and requests for more than $(D n3) bytes are directed to $(D A4). If some particular range should not be handled, $(D NullAllocator) may be used appropriately. diff --git a/std/experimental/allocator/building_blocks/stats_collector.d b/std/experimental/allocator/building_blocks/stats_collector.d index 327c76b3618..23ac5e4c325 100644 --- a/std/experimental/allocator/building_blocks/stats_collector.d +++ b/std/experimental/allocator/building_blocks/stats_collector.d @@ -92,12 +92,12 @@ enum Options : ulong bytesAllocated = 1u << 11, /** Tracks the sum of all $(D delta) values in calls of the form - $(D expand(b, delta)) that succeed (return $(D true)). + `expand(b, delta)` that succeed (return `true`). */ bytesExpanded = 1u << 12, /** - Tracks the sum of all $(D b.length - s) with $(D b.length > s) in calls of - the form $(D realloc(b, s)) that succeed (return $(D true)). In per-call + Tracks the sum of all `b.length - s` with `b.length > s` in calls of + the form `realloc(b, s)` that succeed (return `true`). In per-call statistics, also unambiguously counts the bytes deallocated with $(D deallocate). */ diff --git a/std/experimental/allocator/common.d b/std/experimental/allocator/common.d index f5c2b8526f7..974b82cce51 100644 --- a/std/experimental/allocator/common.d +++ b/std/experimental/allocator/common.d @@ -46,9 +46,9 @@ unittest /** $(D chooseAtRuntime) is a compile-time constant of type $(D size_t) that several parameterized structures in this module recognize to mean deferral to runtime of -the exact value. For example, $(D BitmappedBlock!(Allocator, 4096)) (described in +the exact value. For example, `BitmappedBlock!(Allocator, 4096)` (described in detail below) defines a block allocator with block size of 4096 bytes, whereas -$(D BitmappedBlock!(Allocator, chooseAtRuntime)) defines a block allocator that has a +`BitmappedBlock!(Allocator, chooseAtRuntime)` defines a block allocator that has a field storing the block size, initialized by the user. */ enum chooseAtRuntime = size_t.max - 1; diff --git a/std/experimental/allocator/mallocator.d b/std/experimental/allocator/mallocator.d index 5dfdc999966..1c747318ca0 100644 --- a/std/experimental/allocator/mallocator.d +++ b/std/experimental/allocator/mallocator.d @@ -211,7 +211,7 @@ struct AlignedMallocator enum uint alignment = platformAlignment; /** - Forwards to $(D alignedAllocate(bytes, platformAlignment)). + Forwards to `alignedAllocate(bytes, platformAlignment)`. */ @trusted @nogc nothrow void[] allocate(size_t bytes) shared @@ -281,7 +281,7 @@ struct AlignedMallocator /** On Posix, forwards to $(D realloc). On Windows, forwards to - $(D alignedReallocate(b, newSize, platformAlignment)). + `alignedReallocate(b, newSize, platformAlignment)`. */ version (Posix) @system @nogc nothrow @@ -300,7 +300,7 @@ struct AlignedMallocator On Posix, uses $(D alignedAllocate) and copies data around because there is no realloc for aligned memory. On Windows, calls $(HTTP msdn.microsoft.com/en-US/library/y69db7sx(v=vs.80).aspx, - $(D __aligned_realloc(b.ptr, newSize, a))). + `__aligned_realloc(b.ptr, newSize, a)`). */ version (Windows) @system @nogc nothrow diff --git a/std/experimental/allocator/mmap_allocator.d b/std/experimental/allocator/mmap_allocator.d index cda1509c741..852156ee658 100644 --- a/std/experimental/allocator/mmap_allocator.d +++ b/std/experimental/allocator/mmap_allocator.d @@ -4,11 +4,11 @@ module std.experimental.allocator.mmap_allocator; // MmapAllocator /** -Allocator (currently defined only for Posix and Windows) using $(D $(LUCKY mmap)) -and $(D $(LUCKY munmap)) directly (or their Windows equivalents). There is no +Allocator (currently defined only for Posix and Windows) using `$(LUCKY mmap)` +and `$(LUCKY munmap)` directly (or their Windows equivalents). There is no additional structure: each call to $(D allocate(s)) issues a call to -$(D mmap(null, s, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)), -and each call to $(D deallocate(b)) issues $(D munmap(b.ptr, b.length)). +`mmap(null, s, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)`, +and each call to `deallocate(b)` issues `munmap(b.ptr, b.length)`. So $(D MmapAllocator) is usually intended for allocating large chunks to be managed by fine-granular allocators. diff --git a/std/experimental/allocator/package.d b/std/experimental/allocator/package.d index ba513967d22..e7ce986bbf3 100644 --- a/std/experimental/allocator/package.d +++ b/std/experimental/allocator/package.d @@ -1258,7 +1258,7 @@ T = element type of the array being created alloc = the allocator used for getting memory array = a reference to the array being grown delta = number of elements to add (upon success the new length of $(D array) is -$(D array.length + delta)) +`array.length + delta`) init = element used for filling the array range = range used for initializing the array elements @@ -1411,8 +1411,8 @@ if (isInputRange!R) /** Shrinks an array by $(D delta) elements. -If $(D array.length < delta), does nothing and returns `false`. Otherwise, -destroys the last $(D array.length - delta) elements in the array and then +If `array.length < delta`, does nothing and returns `false`. Otherwise, +destroys the last `array.length - delta` elements in the array and then reallocates the array's buffer. If reallocation fails, fills the array with default-initialized data. @@ -1420,11 +1420,11 @@ Params: T = element type of the array being created alloc = the allocator used for getting memory array = a reference to the array being shrunk -delta = number of elements to remove (upon success the new length of $(D array) is $(D array.length - delta)) +delta = number of elements to remove (upon success the new length of `array` is `array.length - delta`) Returns: `true` upon success, `false` if memory could not be reallocated. In the latter -case, the slice $(D array[$ - delta .. $]) is left with default-initialized +case, the slice `array[$ - delta .. $]` is left with default-initialized elements. Throws: @@ -1897,7 +1897,7 @@ class CAllocatorImpl(Allocator, Flag!"indirect" indirect = No.indirect) else return Ternary.unknown; } - /// Returns $(D impl.expand(b, s)) if defined, $(D false) otherwise. + /// Returns `impl.expand(b, s)` if defined, `false` otherwise. override bool expand(ref void[] b, size_t s) { static if (hasMember!(Allocator, "expand")) @@ -1906,7 +1906,7 @@ class CAllocatorImpl(Allocator, Flag!"indirect" indirect = No.indirect) return s == 0; } - /// Returns $(D impl.reallocate(b, s)). + /// Returns `impl.reallocate(b, s)`. override bool reallocate(ref void[] b, size_t s) { return impl.reallocate(b, s); diff --git a/std/experimental/allocator/typed.d b/std/experimental/allocator/typed.d index 754c9359f0e..8e929fde77f 100644 --- a/std/experimental/allocator/typed.d +++ b/std/experimental/allocator/typed.d @@ -75,17 +75,17 @@ $(T2 AllocFlag.threadLocal |$(NBSP)AllocFlag.hasNoIndirections |$(NBSP)AllocFlag.fixedSize, This is the most specific allocation policy: the memory being allocated is thread local, has no indirections at all, and will not be reallocated. Examples -of types fitting this description: `int`, `double`, $(D Tuple!(int, long)), but -not $(D Tuple!(int, string)), which contains an indirection.) +of types fitting this description: `int`, `double`, `Tuple!(int, long)`, but +not `Tuple!(int, string)`, which contains an indirection.) $(T2 AllocFlag.threadLocal |$(NBSP)AllocFlag.hasNoIndirections, As above, but may be reallocated later. Examples of types fitting this -description are $(D int[]), $(D double[]), $(D Tuple!(int, long)[]), but not -$(D Tuple!(int, string)[]), which contains an indirection.) +description are `int[]`, `double[]`, `Tuple!(int, long)[]`, but not +`Tuple!(int, string)[]`, which contains an indirection.) $(T2 AllocFlag.threadLocal, As above, but may embed indirections. Examples of types fitting this -description are $(D int*[]), $(D Object[]), $(D Tuple!(int, string)[]).) +description are `int*[]`, `Object[]`, `Tuple!(int, string)[]`.) $(T2 AllocFlag.immutableShared |$(NBSP)AllocFlag.hasNoIndirections |$(NBSP)AllocFlag.fixedSize, @@ -309,7 +309,7 @@ struct TypedAllocator(PrimaryAllocator, Policies...) T = element type of the array being created array = a reference to the array being grown delta = number of elements to add (upon success the new length of `array` - is $(D array.length + delta)) + is `array.length + delta`) init = element used for filling the array range = range used for initializing the array elements @@ -341,8 +341,8 @@ struct TypedAllocator(PrimaryAllocator, Policies...) /** Shrinks an array by `delta` elements using `allocatorFor!(T[])`. - If $(D arr.length < delta), does nothing and returns `false`. Otherwise, - destroys the last $(D arr.length - delta) elements in the array and then + If `arr.length < delta`, does nothing and returns `false`. Otherwise, + destroys the last `arr.length - delta` elements in the array and then reallocates the array's buffer. If reallocation fails, fills the array with default-initialized data. @@ -350,11 +350,11 @@ struct TypedAllocator(PrimaryAllocator, Policies...) T = element type of the array being created arr = a reference to the array being shrunk delta = number of elements to remove (upon success the new length of - `arr` is $(D arr.length - delta)) + `arr` is `arr.length - delta`) Returns: `true` upon success, `false` if memory could not be reallocated. In the - latter case $(D arr[$ - delta .. $]) is left with default-initialized + latter case `arr[$ - delta .. $]` is left with default-initialized elements. Throws: diff --git a/std/experimental/logger/core.d b/std/experimental/logger/core.d index 62b3b184ca7..432c9c018d4 100644 --- a/std/experimental/logger/core.d +++ b/std/experimental/logger/core.d @@ -1652,7 +1652,7 @@ sharedLog = new FileLogger(yourFile); The example sets a new $(D FileLogger) as new $(D sharedLog). If at some point you want to use the original default logger again, you can -use $(D sharedLog = null;). This will put back the original. +use `sharedLog = null;`. This will put back the original. Note: While getting and setting $(D sharedLog) is thread-safe, it has to be considered diff --git a/std/experimental/logger/package.d b/std/experimental/logger/package.d index d0d141d1dba..9372884a70d 100644 --- a/std/experimental/logger/package.d +++ b/std/experimental/logger/package.d @@ -102,7 +102,7 @@ the logger. $(H4 Printf Style Logging) If $(D printf)-style logging is needed add a $(B f) to the logging call, such as -$(D myLogger.infof("Hello %s", "world");) or $(D fatalf("errno %d", 1337)). +`myLogger.infof("Hello %s", "world");` or `fatalf("errno %d", 1337)`. The additional $(B f) appended to the function name enables $(D printf)-style logging for all combinations of explicit $(D LogLevel) and conditional logging functions and methods. @@ -169,7 +169,7 @@ $(H3 Provided Logger) By default four $(D Logger) implementations are given. The $(D FileLogger) logs data to files. It can also be used to log to $(D stdout) and $(D stderr) as these devices are files as well. A $(D Logger) that logs to $(D stdout) can -therefore be created by $(D new FileLogger(stdout)). +therefore be created by `new FileLogger(stdout)`. The $(D MultiLogger) is basically an associative array of $(D string)s to $(D Logger). It propagates log calls to its stored $(D Logger). The $(D ArrayLogger) contains an array of $(D Logger) and also propagates log diff --git a/std/file.d b/std/file.d index 1ad4b448212..b0972b1ef4d 100644 --- a/std/file.d +++ b/std/file.d @@ -1512,7 +1512,7 @@ private bool existsImpl(const(FSChar)* namez) @trusted nothrow @nogc completely different. On Windows, they're what is returned by $(HTTP msdn.microsoft.com/en-us/library/aa364944(v=vs.85).aspx, GetFileAttributes), whereas on Posix systems, they're the $(LUCKY - st_mode) value which is part of the $(D stat struct) gotten by + st_mode) value which is part of the `stat struct` gotten by calling the $(HTTP en.wikipedia.org/wiki/Stat_%28Unix%29, $(D stat)) function. diff --git a/std/format.d b/std/format.d index f1b729972da..7c8544ad7c0 100644 --- a/std/format.d +++ b/std/format.d @@ -14,16 +14,16 @@ $(BOOKTABLE , $(TR $(TH Function Name) $(TH Description) ) - $(TR $(TD $(D $(LREF formattedRead))) + $(TR $(TD `$(LREF formattedRead)`) $(TD Reads values according to the _format string from an InputRange. )) - $(TR $(TD $(D $(LREF formattedWrite))) + $(TR $(TD `$(LREF formattedWrite)`) $(TD Formats its arguments according to the _format string and puts them to an OutputRange. )) ) - Please see the documentation of function $(D $(LREF formattedWrite)) for a + Please see the documentation of function `$(LREF formattedWrite)` for a description of the _format string. Two functions have been added for convenience: @@ -31,10 +31,10 @@ $(TR $(TH Function Name) $(TH Description) $(BOOKTABLE , $(TR $(TH Function Name) $(TH Description) ) - $(TR $(TD $(D $(LREF _format))) + $(TR $(TD `$(LREF _format)`) $(TD Returns a GC-allocated string with the formatting result. )) - $(TR $(TD $(D $(LREF sformat))) + $(TR $(TD `$(LREF sformat)`) $(TD Puts the formatting result into a preallocated array. )) ) @@ -42,7 +42,7 @@ $(TR $(TH Function Name) $(TH Description) These two functions are publicly imported by $(MREF std, string) to be easily available. - The functions $(D $(LREF formatValue)) and $(D $(LREF unformatValue)) are + The functions `$(LREF formatValue)` and `$(LREF unformatValue)` are used for the plumbing. Copyright: Copyright Digital Mars 2000-2013. @@ -89,7 +89,7 @@ private alias enforceFmt = enforceEx!FormatException; Interprets variadic argument list $(D args), formats them according to $(D fmt), and sends the resulting characters to $(D w). The encoding of the output is the same as $(D Char). The type $(D Writer) - must satisfy $(D $(REF isOutputRange, std,range,primitives)!(Writer, Char)). + must satisfy `$(REF isOutputRange, std,range,primitives)!(Writer, Char)`. The variadic arguments are normally consumed in order. POSIX-style $(HTTP opengroup.org/onlinepubs/009695399/functions/printf.html, @@ -931,7 +931,7 @@ if (is(Unqual!Char == Char)) bool flZero; /** - The format specifier contained a $(D ' ') ($(D printf) + The format specifier contained a `' '` (`printf` compatibility). */ bool flSpace; @@ -1007,7 +1007,7 @@ if (is(Unqual!Char == Char)) /* This string is inserted in between elements of a sequence (by - default $(D ", ")). + default `", "`). */ enum immutable(Char)[] seqSeparator = ", "; @@ -2872,7 +2872,7 @@ if (!is(StringTypeOf!T) && !is(CharTypeOf!T) || is(T == enum)) } /** - Associative arrays are formatted by using $(D ':') and $(D ", ") as + Associative arrays are formatted by using `':'` and `", "` as separators, and enclosed by $(D '[') and $(D ']'). Params: @@ -3119,7 +3119,7 @@ const string toString(); For the struct and union objects which does not have $(D toString), $(UL $(LI If they have range interface, formatted as input range.) - $(LI Otherwise, they are formatted like $(D Type(field1, filed2, ...)).)) + $(LI Otherwise, they are formatted like `Type(field1, filed2, ...)`.)) Otherwise, are formatted just as their type name. */ diff --git a/std/functional.d b/std/functional.d index e8db7f864e2..001011f73fd 100644 --- a/std/functional.d +++ b/std/functional.d @@ -10,38 +10,38 @@ $(MREF std, algorithm) or $(MREF std, range). $(BOOKTABLE , $(TR $(TH Function Name) $(TH Description) ) - $(TR $(TD $(D $(LREF adjoin))) + $(TR $(TD `$(LREF adjoin)`) $(TD Joins a couple of functions into one that executes the original functions independently and returns a tuple with all the results. )) - $(TR $(TD $(D $(LREF compose)), $(D $(LREF pipe))) + $(TR $(TD `$(LREF compose)`, `$(LREF pipe)`) $(TD Join a couple of functions into one that executes the original functions one after the other, using one function's result for the next function's argument. )) - $(TR $(TD $(D $(LREF forward))) + $(TR $(TD `$(LREF forward)`) $(TD Forwards function arguments while saving ref-ness. )) - $(TR $(TD $(D $(LREF lessThan)), $(D $(LREF greaterThan)), $(D $(LREF equalTo))) + $(TR $(TD `$(LREF lessThan)`, `$(LREF greaterThan)`, `$(LREF equalTo)`) $(TD Ready-made predicate functions to compare two values. )) - $(TR $(TD $(D $(LREF memoize))) + $(TR $(TD `$(LREF memoize)`) $(TD Creates a function that caches its result for fast re-evaluation. )) - $(TR $(TD $(D $(LREF not))) + $(TR $(TD `$(LREF not)`) $(TD Creates a function that negates another. )) - $(TR $(TD $(D $(LREF partial))) + $(TR $(TD `$(LREF partial)`) $(TD Creates a function that binds the first argument of a given function to a given value. )) - $(TR $(TD $(D $(LREF reverseArgs)), $(D $(LREF binaryReverseArgs))) + $(TR $(TD `$(LREF reverseArgs)`, `$(LREF binaryReverseArgs)`) $(TD Predicate that reverses the order of its arguments. )) - $(TR $(TD $(D $(LREF toDelegate))) + $(TR $(TD `$(LREF toDelegate)`) $(TD Converts a callable to a delegate. )) - $(TR $(TD $(D $(LREF unaryFun)), $(D $(LREF binaryFun))) + $(TR $(TD `$(LREF unaryFun)`, `$(LREF binaryFun)`) $(TD Create a unary or binary function from a string. Most often used when defining algorithms on ranges. )) @@ -531,7 +531,7 @@ alias equalTo = safeOp!"=="; } /** N-ary predicate that reverses the order of arguments, e.g., given - $(D pred(a, b, c)), returns $(D pred(c, b, a)). + `pred(a, b, c)`, returns `pred(c, b, a)`. */ template reverseArgs(alias pred) { @@ -581,7 +581,7 @@ template reverseArgs(alias pred) /** Binary predicate that reverses the order of arguments, e.g., given - $(D pred(a, b)), returns $(D pred(b, a)). + `pred(a, b)`, returns `pred(b, a)`. */ template binaryReverseArgs(alias pred) { @@ -792,7 +792,7 @@ invocation, the returned tuple is the adjoined results of all functions. Note: In the special case where only a single function is provided -($(D F.length == 1)), adjoin simply aliases to the single passed function +(`F.length == 1`), adjoin simply aliases to the single passed function ($(D F[0])). */ template adjoin(F...) @@ -881,7 +881,7 @@ if (F.length > 1) } /** - Composes passed-in functions $(D fun[0], fun[1], ...) returning a + Composes passed-in functions `fun[0], fun[1], ...` returning a function $(D f(x)) that in turn returns $(D fun[0](fun[1](...(x)))...). Each function can be a regular functions, a delegate, or a string. diff --git a/std/getopt.d b/std/getopt.d index e5b2c2ef793..a571a45ff3b 100644 --- a/std/getopt.d +++ b/std/getopt.d @@ -130,7 +130,7 @@ void main(string[] args) --------- To set $(D timeout) to $(D 5), invoke the program with either - $(D --timeout=5) or $(D --timeout 5). + `--timeout=5` or `--timeout 5`. ) $(LI $(I Incremental options.) If an option name has a "+" suffix and is @@ -160,7 +160,7 @@ void main(string[] args) --------- To set $(D color) to $(D Color.yes), invoke the program with either - $(D --color=yes) or $(D --color yes). + `--color=yes` or `--color yes`. ) $(LI $(I String options.) If an option is bound to a string, a string is @@ -188,7 +188,7 @@ getopt(args, "output", &outputFiles); Invoking the program with "--output=myfile.txt --output=yourfile.txt" or "--output myfile.txt --output yourfile.txt" will set $(D outputFiles) to - $(D [ "myfile.txt", "yourfile.txt" ]). + `[ "myfile.txt", "yourfile.txt" ]`. Alternatively you can set $(LREF arraySep) as the element separator: @@ -228,8 +228,8 @@ getopt(args, "tune", &tuningParms); ) $(LI $(I Callback options.) An option can be bound to a function or - delegate with the signature $(D void function()), $(D void function(string - option)), $(D void function(string option, string value)), or their + delegate with the signature `void function()`, `void function(string + option)), `void function(string option, string value)`, or their delegate equivalents. $(UL @@ -355,14 +355,14 @@ getopt(args, "timeout|t", &timeout); --------- To set $(D timeout) to $(D 5), use either of the following: $(D --timeout=5), -$(D --timeout 5), $(D --t=5), $(D --t 5), or $(D -t5). Forms such as $(D -t 5) +`--timeout 5`, `--t=5`, `--t 5`, or `-t5`. Forms such as `-t 5` and $(D -timeout=5) will be not accepted. For more details about short options, refer also to the next section. Bundling: Single-letter options can be bundled together, i.e. "-abc" is the same as -$(D "-a -b -c"). By default, this option is turned off. You can turn it on +`"-a -b -c"`. By default, this option is turned off. You can turn it on with the $(D std.getopt.config.bundling) directive: --------- @@ -411,14 +411,14 @@ Help_Information_Generation: If an option string is followed by another string, this string serves as a description for this option. The $(D getopt) function returns a struct of type $(D GetoptResult). This return value contains information about all passed options -as well a $(D bool GetoptResult.helpWanted) flag indicating whether information +as well a `bool GetoptResult.helpWanted` flag indicating whether information about these options was requested. The $(D getopt) function always adds an option for `--help|-h` to set the flag if the option is seen on the command line. Options_Terminator: A lone double-dash terminates $(D getopt) gathering. It is used to separate program options from other parameters (e.g., options to be passed -to another program). Invoking the example above with $(D "--foo -- --bar") +to another program). Invoking the example above with `"--foo -- --bar"` parses foo but leaves "--bar" in $(D args). The double-dash itself is removed from the argument array unless the $(D std.getopt.config.keepEndOfOptions) directive is given. diff --git a/std/internal/cstring.d b/std/internal/cstring.d index 626ea9a0f7f..64aba4f0d02 100644 --- a/std/internal/cstring.d +++ b/std/internal/cstring.d @@ -62,8 +62,8 @@ Params: Returns: -The value returned is implicitly convertible to $(D const To*) and -has two properties: $(D ptr) to access $(I C string) as $(D const To*) +The value returned is implicitly convertible to `const To*` and +has two properties: `ptr` to access $(I C string) as `const To*` and $(D buffPtr) to access it as $(D To*). The value returned can be indexed by [] to access it as an array. diff --git a/std/internal/unicode_tables.d b/std/internal/unicode_tables.d index 3d9005dc324..cc821ca2250 100644 --- a/std/internal/unicode_tables.d +++ b/std/internal/unicode_tables.d @@ -11078,4 +11078,4 @@ _IUA toTitleTable() return t; } } -} \ No newline at end of file +} diff --git a/std/math.d b/std/math.d index db8071632ff..f58e2893e70 100644 --- a/std/math.d +++ b/std/math.d @@ -5464,8 +5464,8 @@ if (isIntegral!(X) && isFloatingPoint!(R)) } /********************************* -Returns $(D -1) if $(D x < 0), $(D x) if $(D x == 0), $(D 1) if -$(D x > 0), and $(NAN) if x==$(NAN). +Returns `-1` if `x < 0`, `x` if `x == 0`, `1` if +`x > 0`, and $(NAN) if x==$(NAN). */ F sgn(F)(F x) @safe pure nothrow @nogc { @@ -7068,7 +7068,7 @@ bool approxEqual(T, U, V)(T lhs, U rhs, V maxRelDiff, V maxAbsDiff = 1e-5) } /** - Returns $(D approxEqual(lhs, rhs, 1e-2, 1e-5)). + Returns `approxEqual(lhs, rhs, 1e-2, 1e-5)`. */ bool approxEqual(T, U)(T lhs, U rhs) { diff --git a/std/net/curl.d b/std/net/curl.d index 348ab107dfb..1ce1f2168d7 100644 --- a/std/net/curl.d +++ b/std/net/curl.d @@ -23,7 +23,7 @@ SMTP) ) ) Note: -You may need to link to the $(B curl) library, e.g. by adding $(D "libs": ["curl"]) +You may need to link to the $(B curl) library, e.g. by adding `"libs": ["curl"]` to your $(B dub.json) file if you are using $(LINK2 http://code.dlang.org, DUB). Windows x86 note: diff --git a/std/net/isemail.d b/std/net/isemail.d index c2c80c11f77..9284deb4294 100644 --- a/std/net/isemail.d +++ b/std/net/isemail.d @@ -1872,12 +1872,12 @@ T[] substr (T) (T[] str, ptrdiff_t start = 0, ptrdiff_t length = ptrdiff_t.min) * caseInsensitive = if true, a case-insensitive comparison will be made, * otherwise a case-sensitive comparison will be made * - * Returns: (for $(D pred = "a < b")): + * Returns: (for `pred = "a < b"`): * * $(BOOKTABLE, - * $(TR $(TD $(D < 0)) $(TD $(D s1 < s2) )) - * $(TR $(TD $(D = 0)) $(TD $(D s1 == s2))) - * $(TR $(TD $(D > 0)) $(TD $(D s1 > s2))) + * $(TR $(TD `< 0`) $(TD `s1 < s2` )) + * $(TR $(TD `= 0`) $(TD `s1 == s2`)) + * $(TR $(TD `> 0`) $(TD `s1 > s2`)) * ) */ int compareFirstN(alias pred = "a < b", S1, S2) (S1 s1, S2 s2, size_t length) diff --git a/std/numeric.d b/std/numeric.d index 4b9fc271688..8b4c7dc0b25 100644 --- a/std/numeric.d +++ b/std/numeric.d @@ -665,7 +665,7 @@ The necessity of $(D FPTemporary) stems from the optimized floating-point operations and registers present in virtually all processors. When adding numbers in the example above, the addition may in fact be done in $(D real) precision internally. In that case, -storing the intermediate $(D result) in $(D double format) is not only +storing the intermediate `result` in `double format` is not only less precise, it is also (surprisingly) slower, because a conversion from $(D real) to $(D double) is performed every pass through the loop. This being a lose-lose situation, $(D FPTemporary!F) has been @@ -706,7 +706,7 @@ if (isFloatingPoint!F) /** Implements the $(HTTP tinyurl.com/2zb9yr, secant method) for finding a -root of the function $(D fun) starting from points $(D [xn_1, x_n]) +root of the function `fun` starting from points `[xn_1, x_n]` (ideally close to the root). $(D Num) may be $(D float), $(D double), or $(D real). */ @@ -1821,7 +1821,7 @@ if (isInputRange!(Range1) && isInputRange!(Range2)) /** Normalizes values in $(D range) by multiplying each element with a number chosen such that values sum up to $(D sum). If elements in $(D -range) sum to zero, assigns $(D sum / range.length) to +range) sum to zero, assigns `sum / range.length` to all. Normalization makes sense only if all elements in $(D range) are positive. $(D normalize) assumes that is the case without checking it. @@ -1926,7 +1926,7 @@ if (isInputRange!Range && isFloatingPoint!(ElementType!Range)) /** Computes $(LUCKY _entropy) of input range $(D r) in bits. This function assumes (without checking) that the values in $(D r) are all -in $(D [0, 1]). For the entropy to be meaningful, often $(D r) should +in `[0, 1]`. For the entropy to be meaningful, often `r` should be normalized too (i.e., its values should sum to 1). The two-parameter version stops evaluating as soon as the intermediate result is greater than or equal to $(D max). @@ -1973,13 +1973,13 @@ if (isInputRange!Range && /** Computes the $(LUCKY Kullback-Leibler divergence) between input ranges -$(D a) and $(D b), which is the sum $(D ai * log(ai / bi)). The base +`a` and `b`, which is the sum `ai * log(ai / bi)`. The base of logarithm is 2. The ranges are assumed to contain elements in $(D [0, 1]). Usually the ranges are normalized probability distributions, but this is not required or checked by $(D kullbackLeiblerDivergence). If any element $(D bi) is zero and the corresponding element $(D ai) nonzero, returns infinity. (Otherwise, -if $(D ai == 0 && bi == 0), the term $(D ai * log(ai / bi)) is +if `ai == 0 && bi == 0`, the term `ai * log(ai / bi)` is considered zero.) If the inputs are normalized, the result is positive. */ @@ -2021,12 +2021,12 @@ if (isInputRange!(Range1) && isInputRange!(Range2)) /** Computes the $(LUCKY Jensen-Shannon divergence) between $(D a) and $(D -b), which is the sum $(D (ai * log(2 * ai / (ai + bi)) + bi * log(2 * +b), which is the sum `(ai * log(2 * ai / (ai + bi)) + bi * log(2 * bi / (ai + bi))) / 2). The base of logarithm is 2. The ranges are -assumed to contain elements in $(D [0, 1]). Usually the ranges are +assumed to contain elements in `[0, 1]`. Usually the ranges are normalized probability distributions, but this is not required or checked by $(D jensenShannonDivergence). If the inputs are normalized, -the result is bounded within $(D [0, 1]). The three-parameter version +the result is bounded within `[0, 1]`. The three-parameter version stops evaluations as soon as the intermediate result is greater than or equal to $(D limit). */ @@ -2108,18 +2108,18 @@ similarity measure between $(D s) and $(D t) based on all of their common subsequences of all lengths. Gapped subsequences are also included. -To understand what $(D gapWeightedSimilarity(s, t, lambda)) computes, -consider first the case $(D lambda = 1) and the strings $(D s = +To understand what `gapWeightedSimilarity(s, t, lambda)` computes, +consider first the case `lambda = 1` and the strings `s = ["Hello", "brave", "new", "world"]) and $(D t = ["Hello", "new", "world"]). In that case, $(D gapWeightedSimilarity) counts the following matches: $(OL $(LI three matches of length 1, namely $(D "Hello"), $(D "new"), and $(D "world");) $(LI three matches of length 2, namely ($(D -"Hello", "new")), ($(D "Hello", "world")), and ($(D "new", "world"));) -$(LI one match of length 3, namely ($(D "Hello", "new", "world")).)) +"Hello", "new")), (`"Hello", "world"`), and (`"new", "world"`);) +$(LI one match of length 3, namely (`"Hello", "new", "world"`).)) -The call $(D gapWeightedSimilarity(s, t, 1)) simply counts all of +The call `gapWeightedSimilarity(s, t, 1)` simply counts all of these matches and adds them up, returning 7. ---- @@ -2131,7 +2131,7 @@ assert(gapWeightedSimilarity(s, t, 1) == 7); Note how the gaps in matching are simply ignored, for example ($(D "Hello", "new")) is deemed as good a match as ($(D "new", "world")). This may be too permissive for some applications. To -eliminate gapped matches entirely, use $(D lambda = 0): +eliminate gapped matches entirely, use `lambda = 0`: ---- string[] s = ["Hello", "brave", "new", "world"]; @@ -2139,8 +2139,8 @@ string[] t = ["Hello", "new", "world"]; assert(gapWeightedSimilarity(s, t, 0) == 4); ---- -The call above eliminated the gapped matches ($(D "Hello", "new")), -($(D "Hello", "world")), and ($(D "Hello", "new", "world")) from the +The call above eliminated the gapped matches (`"Hello", "new"`), +(`"Hello", "world"`), and (`"Hello", "new", "world"`) from the tally. That leaves only 4 matches. The most interesting case is when gapped matches still participate in @@ -2151,12 +2151,12 @@ into play: gapped matches are $(I exponentially penalized with the number of gaps) with base $(D lambda). This means that an ungapped match adds 1 to the return value; a match with one gap in either string adds $(D lambda) to the return value; ...; a match with a total -of $(D n) gaps in both strings adds $(D pow(lambda, n)) to the return +of `n` gaps in both strings adds `pow(lambda, n)` to the return value. In the example above, we have 4 matches without gaps, 2 matches with one gap, and 1 match with three gaps. The latter match is ($(D "Hello", "world")), which has two gaps in the first string and one gap in the second string, totaling to three gaps. Summing these up we get -$(D 4 + 2 * lambda + pow(lambda, 3)). +`4 + 2 * lambda + pow(lambda, 3)`. ---- string[] s = ["Hello", "brave", "new", "world"]; @@ -2239,16 +2239,16 @@ not actually very similar. For example, the range $(D ["Hello", "world", "world", "world",...]) as more instances of $(D "world") are appended. To prevent that, $(D gapWeightedSimilarityNormalized) computes a normalized version of the similarity that is computed as -$(D gapWeightedSimilarity(s, t, lambda) / +`gapWeightedSimilarity(s, t, lambda) / sqrt(gapWeightedSimilarity(s, t, lambda) * gapWeightedSimilarity(s, t, lambda))). The function $(D gapWeightedSimilarityNormalized) (a -so-called normalized kernel) is bounded in $(D [0, 1]), reaches $(D 0) +so-called normalized kernel) is bounded in `[0, 1]`, reaches `0` only for ranges that don't match in any position, and $(D 1) only for identical ranges. The optional parameters $(D sSelfSim) and $(D tSelfSim) are meant for avoiding duplicate computation. Many applications may have already -computed $(D gapWeightedSimilarity(s, s, lambda)) and/or $(D +computed `gapWeightedSimilarity(s, s, lambda)` and/or $(D gapWeightedSimilarity(t, t, lambda)). In that case, they can be passed as $(D sSelfSim) and $(D tSelfSim), respectively. */ diff --git a/std/parallelism.d b/std/parallelism.d index cb7d56fdcde..fe3dc8ab9d5 100644 --- a/std/parallelism.d +++ b/std/parallelism.d @@ -3085,7 +3085,7 @@ public: rudimentary scheduler for tasks which communicate by means other than return values. - Warning: Calling this function with $(D blocking = true) from a worker + Warning: Calling this function with `blocking = true` from a worker thread that is a member of the same $(D TaskPool) that $(D finish) is being called on will result in a deadlock. */ diff --git a/std/path.d b/std/path.d index 701ac3b2534..eb24daa4b91 100644 --- a/std/path.d +++ b/std/path.d @@ -2944,9 +2944,9 @@ if (isConvertibleToString!R1 || isConvertibleToString!R2) b = A filename character. Returns: - $(D < 0) if $(D a < b), - $(D 0) if $(D a == b), and - $(D > 0) if $(D a > b). + `< 0` if `a < b`, + `0` if `a == b`, and + `> 0` if `a > b`. */ int filenameCharCmp(CaseSensitive cs = CaseSensitive.osDefault)(dchar a, dchar b) @safe pure nothrow @@ -3017,9 +3017,9 @@ int filenameCharCmp(CaseSensitive cs = CaseSensitive.osDefault)(dchar a, dchar b filename2 = range for second file name Returns: - $(D < 0) if $(D filename1 < filename2), - $(D 0) if $(D filename1 == filename2) and - $(D > 0) if $(D filename1 > filename2). + `< 0` if `filename1 < filename2`, + `0` if `filename1 == filename2` and + `> 0` if `filename1 > filename2`. See_Also: $(LREF filenameCharCmp) @@ -3423,7 +3423,7 @@ if (isConvertibleToString!Range) representation is in the range 0-31.) $(LI $(D filename) must not contain any of the following $(I reserved characters): <>:"/\|?*) - $(LI $(D filename) may not end with a space ($(D ' ')) or a period + $(LI `filename` may not end with a space (`' '`) or a period ($(D '.')).) ) @@ -3564,7 +3564,7 @@ unittest $(LI If the second character of $(D path) is a colon ($(D ':')), the first character is interpreted as a drive letter, and must be in the range A-Z (case insensitive).) - $(LI If $(D path) is on the form $(D `\\$(I server)\$(I share)\...`) + $(LI If `path` is on the form ``\\$(I server)\$(I share)\...`` (UNC path), $(LREF isValidFilename) is applied to $(I server) and $(I share) as well.) $(LI If $(D path) starts with $(D `\\?\`) (long UNC path), the diff --git a/std/process.d b/std/process.d index bf95e6af725..31421a72f31 100644 --- a/std/process.d +++ b/std/process.d @@ -80,8 +80,8 @@ License: Source: $(PHOBOSSRC std/_process.d) Macros: - OBJECTREF=$(D $(LINK2 object.html#$0,$0)) - LREF=$(D $(LINK2 #.$0,$0)) + OBJECTREF=`$(LINK2 object.html#$0,$0)` + LREF=`$(LINK2 #.$0,$0)` */ module std.process; @@ -1463,7 +1463,7 @@ get the exit code, but also to avoid the process becoming a "zombie" when it finally terminates. (See $(LREF wait) for details). Returns: -An $(D std.typecons.Tuple!(bool, "terminated", int, "status")). +An `std.typecons.Tuple!(bool, "terminated", int, "status")`. Throws: $(LREF ProcessException) on failure. @@ -1515,7 +1515,7 @@ The process will be $(LINK2 http://msdn.microsoft.com/en-us/library/windows/desktop/ms686714%28v=vs.100%29.aspx, forcefully and abruptly terminated). If $(D codeOrSignal) is specified, it must be a nonnegative number which will be used as the exit code of the process. -If not, the process wil exit with code 1. Do not use $(D codeOrSignal = 259), +If not, the process wil exit with code 1. Do not use `codeOrSignal = 259`, as this is a special value (aka. $(LINK2 http://msdn.microsoft.com/en-us/library/windows/desktop/ms683189.aspx,STILL_ACTIVE)) used by Windows to signal that a process has in fact $(I not) terminated yet. --- @@ -1970,7 +1970,7 @@ enum Redirect /** Redirect _all three streams. This is equivalent to - $(D Redirect.stdin | Redirect.stdout | Redirect.stderr). + `Redirect.stdin | Redirect.stdout | Redirect.stderr`. */ all = stdin | stdout | stderr, @@ -2178,7 +2178,7 @@ shellPath = The path to the shell to use to run the specified program. Returns: -An $(D std.typecons.Tuple!(int, "status", string, "output")). +An `std.typecons.Tuple!(int, "status", string, "output")`. POSIX_specific: If the process is terminated by a signal, the $(D status) field of @@ -3522,7 +3522,7 @@ version (StdDdoc) $(BLUE This functions is Posix-Only.) Typically, the first element of $(D argv) is - the command being executed, i.e. $(D argv[0] == pathname). The 'p' + the command being executed, i.e. `argv[0] == pathname`. The 'p' versions of $(D exec) search the PATH environment variable for $(D pathname). The 'e' versions additionally take the new process' environment variables as an array of strings of the form key=value. diff --git a/std/random.d b/std/random.d index a7b0b67c69d..f5d02336fa1 100644 --- a/std/random.d +++ b/std/random.d @@ -255,9 +255,9 @@ if (isUnsigned!UIntType) enum bool isUniformRandom = true; /// Does this generator have a fixed range? ($(D_PARAM true)). enum bool hasFixedRange = true; - /// Lowest generated value ($(D 1) if $(D c == 0), $(D 0) otherwise). + /// Lowest generated value (`1` if `c == 0`, `0` otherwise). enum UIntType min = ( c == 0 ? 1 : 0 ); - /// Highest generated value ($(D modulus - 1)). + /// Highest generated value (`modulus - 1`). enum UIntType max = m - 1; /** The parameters of this distribution. The random number is $(D_PARAM x @@ -1971,7 +1971,7 @@ if (isFloatingPoint!F) /** Returns a random, uniformly chosen, element `e` from the supplied -$(D Range range). If no random number generator is passed, the default +`Range range`. If no random number generator is passed, the default `rndGen` is used. Params: @@ -1981,7 +1981,7 @@ Params: Returns: A single random element drawn from the `range`. If it can, it will - return a `ref` to the $(D range element), otherwise it will return + return a `ref` to the `range element`, otherwise it will return a copy. */ auto ref choice(Range, RandomGen = Random)(auto ref Range range, @@ -2095,9 +2095,9 @@ if (isRandomAccessRange!Range) } /** -Partially shuffles the elements of $(D r) such that upon returning $(D r[0 .. n]) -is a random subset of $(D r) and is randomly ordered. $(D r[n .. r.length]) -will contain the elements not in $(D r[0 .. n]). These will be in an undefined +Partially shuffles the elements of `r` such that upon returning `r[0 .. n]` +is a random subset of `r` and is randomly ordered. `r[n .. r.length]` +will contain the elements not in `r[0 .. n]`. These will be in an undefined order, but will not be random in the sense that their order after $(D partialShuffle) returns will not be independent of their order before $(D partialShuffle) was called. @@ -2546,7 +2546,7 @@ O(total). RandomSample will throw an exception if $(D total) is verifiably less than the total number of elements available in the input, -or if $(D n > total). +or if `n > total`. If no random number generator is passed to $(D randomSample), the thread-global RNG rndGen will be used internally. diff --git a/std/range/interfaces.d b/std/range/interfaces.d index f9c7d8ddcda..784d44d16d2 100644 --- a/std/range/interfaces.d +++ b/std/range/interfaces.d @@ -8,45 +8,45 @@ provides a number of object and $(D interface) definitions that can be used to wrap around _range objects created by the $(D std.range) templates. $(BOOKTABLE , - $(TR $(TD $(D $(LREF InputRange))) + $(TR $(TD `$(LREF InputRange)`) $(TD Wrapper for input ranges. )) - $(TR $(TD $(D $(LREF InputAssignable))) + $(TR $(TD `$(LREF InputAssignable)`) $(TD Wrapper for input ranges with assignable elements. )) - $(TR $(TD $(D $(LREF ForwardRange))) + $(TR $(TD `$(LREF ForwardRange)`) $(TD Wrapper for forward ranges. )) - $(TR $(TD $(D $(LREF ForwardAssignable))) + $(TR $(TD `$(LREF ForwardAssignable)`) $(TD Wrapper for forward ranges with assignable elements. )) - $(TR $(TD $(D $(LREF BidirectionalRange))) + $(TR $(TD `$(LREF BidirectionalRange)`) $(TD Wrapper for bidirectional ranges. )) - $(TR $(TD $(D $(LREF BidirectionalAssignable))) + $(TR $(TD `$(LREF BidirectionalAssignable)`) $(TD Wrapper for bidirectional ranges with assignable elements. )) - $(TR $(TD $(D $(LREF RandomAccessFinite))) + $(TR $(TD `$(LREF RandomAccessFinite)`) $(TD Wrapper for finite random-access ranges. )) - $(TR $(TD $(D $(LREF RandomAccessAssignable))) + $(TR $(TD `$(LREF RandomAccessAssignable)`) $(TD Wrapper for finite random-access ranges with assignable elements. )) - $(TR $(TD $(D $(LREF RandomAccessInfinite))) + $(TR $(TD `$(LREF RandomAccessInfinite)`) $(TD Wrapper for infinite random-access ranges. )) - $(TR $(TD $(D $(LREF OutputRange))) + $(TR $(TD `$(LREF OutputRange)`) $(TD Wrapper for output ranges. )) - $(TR $(TD $(D $(LREF OutputRangeObject))) + $(TR $(TD `$(LREF OutputRangeObject)`) $(TD Class that implements the $(D OutputRange) interface and wraps the $(D put) methods in virtual functions. )) - $(TR $(TD $(D $(LREF InputRangeObject))) + $(TR $(TD `$(LREF InputRangeObject)`) $(TD Class that implements the $(D InputRange) interface and wraps the input _range methods in virtual functions. )) - $(TR $(TD $(D $(LREF RefRange))) + $(TR $(TD `$(LREF RefRange)`) $(TD Wrapper around a forward _range that gives it reference semantics. )) ) diff --git a/std/range/package.d b/std/range/package.d index 89d45c1754e..25f59ff7d05 100644 --- a/std/range/package.d +++ b/std/range/package.d @@ -33,133 +33,133 @@ The remainder of this module provides a rich set of _range creation and composition templates that let you construct new ranges out of existing ranges: $(BOOKTABLE , - $(TR $(TD $(D $(LREF chain))) + $(TR $(TD $(LREF `chain)`) $(TD Concatenates several ranges into a single _range. )) - $(TR $(TD $(D $(LREF choose))) + $(TR $(TD $(LREF `choose)`) $(TD Chooses one of two ranges at runtime based on a boolean condition. )) - $(TR $(TD $(D $(LREF chooseAmong))) + $(TR $(TD $(LREF `chooseAmong)`) $(TD Chooses one of several ranges at runtime based on an index. )) - $(TR $(TD $(D $(LREF chunks))) + $(TR $(TD $(LREF `chunks)`) $(TD Creates a _range that returns fixed-size chunks of the original _range. )) - $(TR $(TD $(D $(LREF cycle))) + $(TR $(TD $(LREF `cycle)`) $(TD Creates an infinite _range that repeats the given forward _range indefinitely. Good for implementing circular buffers. )) - $(TR $(TD $(D $(LREF drop))) + $(TR $(TD $(LREF `drop)`) $(TD Creates the _range that results from discarding the first $(I n) elements from the given _range. )) - $(TR $(TD $(D $(LREF dropExactly))) + $(TR $(TD $(LREF `dropExactly)`) $(TD Creates the _range that results from discarding exactly $(I n) of the first elements from the given _range. )) - $(TR $(TD $(D $(LREF dropOne))) + $(TR $(TD $(LREF `dropOne)`) $(TD Creates the _range that results from discarding the first elements from the given _range. )) - $(TR $(TD $(D $(LREF enumerate))) + $(TR $(TD $(LREF `enumerate)`) $(TD Iterates a _range with an attached index variable. )) - $(TR $(TD $(D $(LREF evenChunks))) + $(TR $(TD $(LREF `evenChunks)`) $(TD Creates a _range that returns a number of chunks of approximately equal length from the original _range. )) - $(TR $(TD $(D $(LREF frontTransversal))) + $(TR $(TD $(LREF `frontTransversal)`) $(TD Creates a _range that iterates over the first elements of the given ranges. )) - $(TR $(TD $(D $(LREF indexed))) + $(TR $(TD $(LREF `indexed)`) $(TD Creates a _range that offers a view of a given _range as though its elements were reordered according to a given _range of indices. )) - $(TR $(TD $(D $(LREF iota))) + $(TR $(TD $(LREF `iota)`) $(TD Creates a _range consisting of numbers between a starting point and ending point, spaced apart by a given interval. )) - $(TR $(TD $(D $(LREF lockstep))) + $(TR $(TD $(LREF `lockstep)`) $(TD Iterates $(I n) _ranges in lockstep, for use in a $(D foreach) loop. Similar to $(D zip), except that $(D lockstep) is designed especially for $(D foreach) loops. )) - $(TR $(TD $(D $(LREF NullSink))) + $(TR $(TD $(LREF `NullSink)`) $(TD An output _range that discards the data it receives. )) - $(TR $(TD $(D $(LREF only))) + $(TR $(TD $(LREF `only)`) $(TD Creates a _range that iterates over the given arguments. )) - $(TR $(TD $(D $(LREF padLeft))) + $(TR $(TD $(LREF `padLeft)`) $(TD Pads a _range to a specified length by adding a given element to the front of the _range. Is lazy if the range has a known length. )) - $(TR $(TD $(D $(LREF padRight))) + $(TR $(TD $(LREF `padRight)`) $(TD Lazily pads a _range to a specified length by adding a given element to the back of the _range. )) - $(TR $(TD $(D $(LREF radial))) + $(TR $(TD $(LREF `radial)`) $(TD Given a random-access _range and a starting point, creates a _range that alternately returns the next left and next right element to the starting point. )) - $(TR $(TD $(D $(LREF recurrence))) + $(TR $(TD $(LREF `recurrence)`) $(TD Creates a forward _range whose values are defined by a mathematical recurrence relation. )) - $(TR $(TD $(D $(LREF repeat))) + $(TR $(TD $(LREF `repeat)`) $(TD Creates a _range that consists of a single element repeated $(I n) times, or an infinite _range repeating that element indefinitely. )) - $(TR $(TD $(D $(LREF retro))) + $(TR $(TD $(LREF `retro)`) $(TD Iterates a bidirectional _range backwards. )) - $(TR $(TD $(D $(LREF roundRobin))) + $(TR $(TD $(LREF `roundRobin)`) $(TD Given $(I n) ranges, creates a new _range that return the $(I n) first elements of each _range, in turn, then the second element of each _range, and so on, in a round-robin fashion. )) - $(TR $(TD $(D $(LREF sequence))) + $(TR $(TD $(LREF `sequence)`) $(TD Similar to $(D recurrence), except that a random-access _range is created. )) - $(TR $(TD $(D $(LREF stride))) + $(TR $(TD $(LREF `stride)`) $(TD Iterates a _range with stride $(I n). )) - $(TR $(TD $(D $(LREF tail))) + $(TR $(TD $(LREF `tail)`) $(TD Return a _range advanced to within $(D n) elements of the end of the given _range. )) - $(TR $(TD $(D $(LREF take))) + $(TR $(TD $(LREF `take)`) $(TD Creates a sub-_range consisting of only up to the first $(I n) elements of the given _range. )) - $(TR $(TD $(D $(LREF takeExactly))) + $(TR $(TD $(LREF `takeExactly)`) $(TD Like $(D take), but assumes the given _range actually has $(I n) elements, and therefore also defines the $(D length) property. )) - $(TR $(TD $(D $(LREF takeNone))) + $(TR $(TD $(LREF `takeNone)`) $(TD Creates a random-access _range consisting of zero elements of the given _range. )) - $(TR $(TD $(D $(LREF takeOne))) + $(TR $(TD $(LREF `takeOne)`) $(TD Creates a random-access _range consisting of exactly the first element of the given _range. )) - $(TR $(TD $(D $(LREF tee))) + $(TR $(TD $(LREF `tee)`) $(TD Creates a _range that wraps a given _range, forwarding along its elements while also calling a provided function with each element. )) - $(TR $(TD $(D $(LREF transposed))) + $(TR $(TD $(LREF `transposed)`) $(TD Transposes a _range of ranges. )) - $(TR $(TD $(D $(LREF transversal))) + $(TR $(TD $(LREF `transversal)`) $(TD Creates a _range that iterates over the $(I n)'th elements of the given random-access ranges. )) - $(TR $(TD $(D $(LREF zip))) + $(TR $(TD $(LREF `zip)`) $(TD Given $(I n) _ranges, creates a _range that successively returns a tuple of all the first elements, a tuple of all the second elements, etc. @@ -167,8 +167,8 @@ $(BOOKTABLE , ) Ranges whose elements are sorted afford better efficiency with certain -operations. For this, the $(D $(LREF assumeSorted)) function can be used to -construct a $(D $(LREF SortedRange)) from a pre-sorted _range. The $(REF +operations. For this, the $(LREF `assumeSorted`) function can be used to +construct a $(LREF `SortedRange`) from a pre-sorted _range. The $(REF sort, std, algorithm, sorting) function also conveniently returns a $(D SortedRange). $(D SortedRange) objects provide some additional _range operations that take advantage of the fact that the _range is sorted. @@ -594,7 +594,7 @@ body } /** - Forwards to $(D moveAt(source, n)). + Forwards to `moveAt(source, n)`. */ static if (is(typeof(source.moveAt(0)))) { @@ -822,7 +822,7 @@ pure @safe nothrow unittest /** Spans multiple ranges in sequence. The function $(D chain) takes any -number of ranges and returns a $(D Chain!(R1, R2,...)) object. The +number of ranges and returns a `Chain!(R1, R2,...)` object. The ranges may be different, but they must have the same element type. The result is a range that offers the $(D front), $(D popFront), and $(D empty) primitives. If all input ranges offer random access and $(D @@ -1619,7 +1619,7 @@ if (Ranges.length == 2 && is(typeof(choose(true, rs[0], rs[1])))) /** -$(D roundRobin(r1, r2, r3)) yields $(D r1.front), then $(D r2.front), +`roundRobin(r1, r2, r3)` yields `r1.front`, then `r2.front`, then $(D r3.front), after which it pops off one element from each and continues again from $(D r1). For example, if two ranges are involved, it alternately yields elements off the two ranges. $(D roundRobin) @@ -2250,7 +2250,7 @@ pure @safe nothrow @nogc unittest //13151 /** Similar to $(LREF take), but assumes that $(D range) has at least $(D -n) elements. Consequently, the result of $(D takeExactly(range, n)) +n) elements. Consequently, the result of `takeExactly(range, n)` always defines the $(D length) property (and initializes it to $(D n)) even when $(D range) itself does not define $(D length). @@ -2451,7 +2451,7 @@ Returns a range with at most one element; for example, $(D takeOne([42, 43, 44])) returns a range consisting of the integer $(D 42). Calling $(D popFront()) off that range renders it empty. -In effect $(D takeOne(r)) is somewhat equivalent to $(D take(r, 1)) but in +In effect `takeOne(r)` is somewhat equivalent to `take(r, 1)` but in certain interfaces it is important to know statically that the range may only have at most one element. @@ -2602,7 +2602,7 @@ pure @safe nothrow @nogc unittest /++ Creates an empty range from the given range in $(BIGOH 1). If it can, it will return the same range type. If not, it will return - $(D takeExactly(range, 0)). + `takeExactly(range, 0)`. +/ auto takeNone(R)(R range) if (isInputRange!R) @@ -2967,7 +2967,7 @@ if (isBidirectionalRange!R) /++ Similar to $(LREF drop) and $(D dropBack) but they call - $(D range.$(LREF popFrontExactly)(n)) and $(D range.popBackExactly(n)) + `range.$(LREF popFrontExactly)(n)` and `range.popBackExactly(n)` instead. Note: Unlike $(D drop), $(D dropExactly) will assume that the @@ -4880,13 +4880,13 @@ auto fun(R)(R state, size_t n) ---- where $(D n) will be the index of the current value, and $(D state) will be an opaque state vector that can be indexed with array-indexing notation -$(D state[i]), where valid values of $(D i) range from $(D (n - 1)) to -$(D (n - State.length)). +`state[i]`, where valid values of `i` range from `(n - 1)` to +`(n - State.length)`. If the function is passed in string form, the state has name $(D "a") and the zero-based index in the recurrence has name $(D "n"). The given string must return the desired value for $(D a[n]) given $(D a[n -- 1]), $(D a[n - 2]), $(D a[n - 3]),..., $(D a[n - stateSize]). The +- 1]), `a[n - 2]`, `a[n - 3]`,..., `a[n - stateSize]`. The state size is dictated by the number of arguments passed to the call to $(D recurrence). The $(D Recurrence) struct itself takes care of managing the recurrence's state and shifting it appropriately. @@ -5174,12 +5174,12 @@ auto sequence(alias fun, State...)(State args) step = The value to add to the current value at each iteration. Returns: - A range that goes through the numbers $(D begin), $(D begin + step), - $(D begin + 2 * step), $(D ...), up to and excluding $(D end). + A range that goes through the numbers `begin`, `begin + step`, + `begin + 2 * step`, `...`, up to and excluding `end`. - The two-argument overloads have $(D step = 1). If $(D begin < end && step < - 0) or $(D begin > end && step > 0) or $(D begin == end), then an empty range - is returned. If $(D step == 0) then $(D begin == end) is an error. + The two-argument overloads have `step = 1`. If `begin < end && step < + 0) or `begin > end && step > 0` or `begin == end`, then an empty range + is returned. If `step == 0` then `begin == end` is an error. For built-in types, the range returned is a random access range. For user-defined types that support $(D ++), the range is an input @@ -7133,8 +7133,8 @@ known length. Unlike $(LREF chunks), $(D evenChunks) takes a chunk count (not size). The returned range will contain zero or more $(D source.length / -chunkCount + 1) elements followed by $(D source.length / chunkCount) -elements. If $(D source.length < chunkCount), some chunks will be empty. +chunkCount + 1) elements followed by `source.length / chunkCount` +elements. If `source.length < chunkCount`, some chunks will be empty. $(D chunkCount) must not be zero, unless $(D source) is also empty. */ @@ -8408,7 +8408,7 @@ if (isInputRange!Range) // lowerBound /** This function uses a search with policy $(D sp) to find the - largest left subrange on which $(D pred(x, value)) is $(D true) for + largest left subrange on which `pred(x, value)` is `true` for all $(D x) (e.g., if $(D pred) is "less than", returns the portion of the range with elements strictly smaller than $(D value)). The search schedule and its complexity are documented in @@ -8434,7 +8434,7 @@ if (isInputRange!Range) // upperBound /** This function searches with policy $(D sp) to find the largest right -subrange on which $(D pred(value, x)) is $(D true) for all $(D x) +subrange on which `pred(value, x)` is `true` for all `x` (e.g., if $(D pred) is "less than", returns the portion of the range with elements strictly greater than $(D value)). The search schedule and its complexity are documented in $(LREF SearchPolicy). @@ -8479,7 +8479,7 @@ See_Also: STL's $(HTTP sgi.com/tech/stl/lower_bound.html,upper_bound). // equalRange /** Returns the subrange containing all elements $(D e) for which both $(D - pred(e, value)) and $(D pred(value, e)) evaluate to $(D false) (e.g., + pred(e, value)) and `pred(value, e)` evaluate to `false` (e.g., if $(D pred) is "less than", returns the portion of the range with elements equal to $(D value)). Uses a classic binary search with interval halving until it finds a value that satisfies the condition, @@ -8788,7 +8788,7 @@ that break its sortedness, $(D SortedRange) will work erratically. /** Assumes $(D r) is sorted by predicate $(D pred) and returns the -corresponding $(D SortedRange!(pred, R)) having $(D r) as support. To +corresponding `SortedRange!(pred, R)` having `r` as support. To keep the checking costs low, the cost is $(BIGOH 1) in release mode (no checks for sortedness are performed). In debug mode, a few random elements of $(D r) are checked for sortedness. The size of the sample diff --git a/std/range/primitives.d b/std/range/primitives.d index 80a4f7440ac..a79e4e2c4df 100644 --- a/std/range/primitives.d +++ b/std/range/primitives.d @@ -5,28 +5,28 @@ It provides basic range functionality by defining several templates for testing whether a given object is a _range, and what kind of _range it is: $(BOOKTABLE , - $(TR $(TD $(D $(LREF isInputRange))) + $(TR $(TD `$(LREF isInputRange)`) $(TD Tests if something is an $(I input _range), defined to be something from which one can sequentially read data using the primitives $(D front), $(D popFront), and $(D empty). )) - $(TR $(TD $(D $(LREF isOutputRange))) + $(TR $(TD `$(LREF isOutputRange)`) $(TD Tests if something is an $(I output _range), defined to be something to which one can sequentially write data using the - $(D $(LREF put)) primitive. + `$(LREF put)` primitive. )) - $(TR $(TD $(D $(LREF isForwardRange))) + $(TR $(TD `$(LREF isForwardRange)`) $(TD Tests if something is a $(I forward _range), defined to be an input _range with the additional capability that one can save one's current position with the $(D save) primitive, thus allowing one to iterate over the same _range multiple times. )) - $(TR $(TD $(D $(LREF isBidirectionalRange))) + $(TR $(TD `$(LREF isBidirectionalRange)`) $(TD Tests if something is a $(I bidirectional _range), that is, a forward _range that allows reverse traversal using the primitives $(D back) and $(D popBack). )) - $(TR $(TD $(D $(LREF isRandomAccessRange))) + $(TR $(TD `$(LREF isRandomAccessRange)`) $(TD Tests if something is a $(I random access _range), which is a bidirectional _range that also supports the array subscripting operation via the primitive $(D opIndex). @@ -36,33 +36,33 @@ $(BOOKTABLE , It also provides number of templates that test for various _range capabilities: $(BOOKTABLE , - $(TR $(TD $(D $(LREF hasMobileElements))) + $(TR $(TD `$(LREF hasMobileElements)`) $(TD Tests if a given _range's elements can be moved around using the primitives $(D moveFront), $(D moveBack), or $(D moveAt). )) - $(TR $(TD $(D $(LREF ElementType))) + $(TR $(TD `$(LREF ElementType)`) $(TD Returns the element type of a given _range. )) - $(TR $(TD $(D $(LREF ElementEncodingType))) + $(TR $(TD `$(LREF ElementEncodingType)`) $(TD Returns the encoding element type of a given _range. )) - $(TR $(TD $(D $(LREF hasSwappableElements))) + $(TR $(TD `$(LREF hasSwappableElements)`) $(TD Tests if a _range is a forward _range with swappable elements. )) - $(TR $(TD $(D $(LREF hasAssignableElements))) + $(TR $(TD `$(LREF hasAssignableElements)`) $(TD Tests if a _range is a forward _range with mutable elements. )) - $(TR $(TD $(D $(LREF hasLvalueElements))) + $(TR $(TD `$(LREF hasLvalueElements)`) $(TD Tests if a _range is a forward _range with elements that can be passed by reference and have their address taken. )) - $(TR $(TD $(D $(LREF hasLength))) + $(TR $(TD `$(LREF hasLength)`) $(TD Tests if a given _range has the $(D length) attribute. )) - $(TR $(TD $(D $(LREF isInfinite))) + $(TR $(TD `$(LREF isInfinite)`) $(TD Tests if a given _range is an $(I infinite _range). )) - $(TR $(TD $(D $(LREF hasSlicing))) + $(TR $(TD `$(LREF hasSlicing)`) $(TD Tests if a given _range supports the array slicing operation $(D R[x .. y]). )) @@ -71,30 +71,30 @@ $(BOOKTABLE , Finally, it includes some convenience functions for manipulating ranges: $(BOOKTABLE , - $(TR $(TD $(D $(LREF popFrontN))) + $(TR $(TD `$(LREF popFrontN)`) $(TD Advances a given _range by up to $(I n) elements. )) - $(TR $(TD $(D $(LREF popBackN))) + $(TR $(TD `$(LREF popBackN)`) $(TD Advances a given bidirectional _range from the right by up to $(I n) elements. )) - $(TR $(TD $(D $(LREF popFrontExactly))) + $(TR $(TD `$(LREF popFrontExactly)`) $(TD Advances a given _range by up exactly $(I n) elements. )) - $(TR $(TD $(D $(LREF popBackExactly))) + $(TR $(TD `$(LREF popBackExactly)`) $(TD Advances a given bidirectional _range from the right by exactly $(I n) elements. )) - $(TR $(TD $(D $(LREF moveFront))) + $(TR $(TD `$(LREF moveFront)`) $(TD Removes the front element of a _range. )) - $(TR $(TD $(D $(LREF moveBack))) + $(TR $(TD `$(LREF moveBack)`) $(TD Removes the back element of a bidirectional _range. )) - $(TR $(TD $(D $(LREF moveAt))) + $(TR $(TD `$(LREF moveAt)`) $(TD Removes the $(I i)'th element of a random-access _range. )) - $(TR $(TD $(D $(LREF walkLength))) + $(TR $(TD `$(LREF walkLength)`) $(TD Computes the length of any _range in O(n) time. )) ) @@ -190,7 +190,7 @@ template isInputRange(R) /+ puts the whole raw element $(D e) into $(D r). doPut will not attempt to iterate, slice or transcode $(D e) in any way shape or form. It will $(B only) -call the correct primitive ($(D r.put(e)), $(D r.front = e) or +call the correct primitive (`r.put(e)`, `r.front = e` or $(D r(0)) once. This can be important when $(D e) needs to be placed in $(D r) unchanged. @@ -260,7 +260,7 @@ are attempted in order, and the first to compile "wins" and gets evaluated. In this table "doPut" is a method that places $(D e) into $(D r), using the -correct primitive: $(D r.put(e)) if $(D R) defines $(D put), $(D r.front = e) +correct primitive: `r.put(e)` if `R` defines `put`, `r.front = e` if $(D r) is an input range (followed by $(D r.popFront())), or $(D r(e)) otherwise. @@ -274,7 +274,7 @@ $(BOOKTABLE , $(TD $(D R) specifically accepts an $(D E).) ) $(TR - $(TD $(D r.doPut([ e ]);)) + $(TD `r.doPut([ e ]);`) $(TD $(D R) specifically accepts an $(D E[]).) ) $(TR @@ -283,14 +283,14 @@ $(BOOKTABLE , transcode the character $(D e) accordingly.) ) $(TR - $(TD $(D for (; !e.empty; e.popFront()) put(r, e.front);)) + $(TD `for (; !e.empty; e.popFront()) put(r, e.front);`) $(TD Copying range $(D E) into $(D R).) ) ) Tip: $(D put) should $(I not) be used "UFCS-style", e.g. $(D r.put(e)). Doing this may call $(D R.put) directly, by-passing any transformation -feature provided by $(D Range.put). $(D put(r, e)) is prefered. +feature provided by `Range.put`. `put(r, e)` is prefered. +/ void put(R, E)(ref R r, E e) { @@ -678,7 +678,7 @@ pure @safe unittest /+ Returns $(D true) if $(D R) is a native output range for elements of type $(D E). An output range is defined functionally as a range that -supports the operation $(D doPut(r, e)) as defined above. if $(D doPut(r, e)) +supports the operation `doPut(r, e)` as defined above. if `doPut(r, e)` is valid, then $(D put(r,e)) will have the same behavior. The two guarantees isNativeOutputRange gives over the larger $(D isOutputRange) @@ -714,7 +714,7 @@ package(std) template isNativeOutputRange(R, E) /++ Returns $(D true) if $(D R) is an output range for elements of type $(D E). An output range is defined functionally as a range that -supports the operation $(D put(r, e)) as defined above. +supports the operation `put(r, e)` as defined above. +/ template isOutputRange(R, E) { diff --git a/std/regex/package.d b/std/regex/package.d index 6d1ec5fa340..4e84238a037 100644 --- a/std/regex/package.d +++ b/std/regex/package.d @@ -650,7 +650,7 @@ public: Effectively it's a forward range of Captures!R, produced by lazily searching for matches in a given input. - $(D alias Engine) specifies an engine type to use during matching, + `alias Engine` specifies an engine type to use during matching, and is automatically deduced in a call to $(D match)/$(D bmatch). +/ @trusted public struct RegexMatch(R, alias Engine = ThompsonMatcher) diff --git a/std/stdio.d b/std/stdio.d index 2db0e3c9401..10a00e2efdf 100644 --- a/std/stdio.d +++ b/std/stdio.d @@ -1563,7 +1563,7 @@ void main() Read line from the file handle and write it to $(D buf[]), including terminating character. -This can be faster than $(D line = File.readln()) because you can reuse +This can be faster than `line = File.readln()` because you can reuse the buffer for each call. Note that reusing the buffer means that you must copy the previous contents if you wish to retain them. @@ -1605,7 +1605,7 @@ void main() This method can be more efficient than the one in the previous example because $(D stdin.readln(buf)) reuses (if possible) memory allocated -for $(D buf), whereas $(D line = stdin.readln()) makes a new memory allocation +for `buf`, whereas `line = stdin.readln()` makes a new memory allocation for every line. For even better performance you can help $(D readln) by passing in a @@ -2153,7 +2153,7 @@ The element type for the range will be $(D Char[]). Range primitives may throw $(D StdioException) on I/O error. Params: -Char = Character type for each line, defaulting to $(D immutable char). +Char = Character type for each line, defaulting to `immutable char`. keepTerminator = Use $(D Yes.keepTerminator) to include the terminator at the end of each line. terminator = Line separator ($(D '\n') by default). Use @@ -3652,7 +3652,7 @@ void writef(T...)(T args) } /*********************************** - * Equivalent to $(D writef(args, '\n')). + * Equivalent to `writef(args, '\n')`. */ void writefln(T...)(T args) { @@ -3740,7 +3740,7 @@ if (isSomeString!S) /********************************** * Read line from $(D stdin) and write it to buf[], including terminating character. * - * This can be faster than $(D line = readln()) because you can reuse + * This can be faster than `line = readln()` because you can reuse * the buffer for each call. Note that reusing the buffer means that you * must copy the previous contents if you wish to retain them. * @@ -4271,7 +4271,7 @@ private struct ChunksImpl /** Writes an array or range to a file. -Shorthand for $(D data.copy(File(fileName, "wb").lockingBinaryWriter)). +Shorthand for `data.copy(File(fileName, "wb").lockingBinaryWriter)`. Similar to $(REF write, std,file), strings are written as-is, rather than encoded according to the $(D File)'s $(HTTP en.cppreference.com/w/c/io#Narrow_and_wide_orientation, diff --git a/std/string.d b/std/string.d index eb6801dcc43..137c728ee9d 100644 --- a/std/string.d +++ b/std/string.d @@ -972,7 +972,7 @@ unittest Returns: The index of the last occurrence of $(D c) in $(D s). If $(D c) is not found, then $(D -1) is returned. The $(D startIdx) slices $(D s) in - the following way $(D s[0 .. startIdx]). $(D startIdx) represents a + the following way `s[0 .. startIdx]`. `startIdx` represents a codeunit index in $(D s). Throws: @@ -1164,7 +1164,7 @@ if (isSomeChar!Char) Returns: the index of the last occurrence of $(D sub) in $(D s). If $(D sub) is not found, then $(D -1) is returned. The $(D startIdx) slices $(D s) - in the following way $(D s[0 .. startIdx]). $(D startIdx) represents a + in the following way `s[0 .. startIdx]`. `startIdx` represents a codeunit index in $(D s). Throws: @@ -1554,7 +1554,7 @@ if (isSomeChar!Char && isSomeChar!Char2) Returns the index of the first occurence of any of the elements in $(D needles) in $(D haystack). If no element of $(D needles) is found, then $(D -1) is returned. The $(D startIdx) slices $(D haystack) in the - following way $(D haystack[startIdx .. $]). $(D startIdx) represents a + following way `haystack[startIdx .. $]`. `startIdx` represents a codeunit index in $(D haystack). If the sequence ending at $(D startIdx) does not represent a well formed codepoint, then a $(REF UTFException, std,utf) may be thrown. @@ -1562,7 +1562,7 @@ if (isSomeChar!Char && isSomeChar!Char2) Params: haystack = String to search for needles in. needles = Strings to search for in haystack. - startIdx = slices haystack like this $(D haystack[startIdx .. $]). If + startIdx = slices haystack like this `haystack[startIdx .. $]`. If the startIdx is greater equal the length of haystack the functions returns $(D -1). cs = Indicates whether the comparisons are case sensitive. @@ -1725,7 +1725,7 @@ if (isSomeChar!Char && isSomeChar!Char2) Returns the index of the last occurence of any of the elements in $(D needles) in $(D haystack). If no element of $(D needles) is found, then $(D -1) is returned. The $(D stopIdx) slices $(D haystack) in the - following way $(D s[0 .. stopIdx]). $(D stopIdx) represents a codeunit + following way `s[0 .. stopIdx]`. `stopIdx` represents a codeunit index in $(D haystack). If the sequence ending at $(D startIdx) does not represent a well formed codepoint, then a $(REF UTFException, std,utf) may be thrown. @@ -1733,7 +1733,7 @@ if (isSomeChar!Char && isSomeChar!Char2) Params: haystack = String to search for needles in. needles = Strings to search for in haystack. - stopIdx = slices haystack like this $(D haystack[0 .. stopIdx]). If + stopIdx = slices haystack like this `haystack[0 .. stopIdx]`. If the stopIdx is greater equal the length of haystack the functions returns $(D -1). cs = Indicates whether the comparisons are case sensitive. @@ -1916,7 +1916,7 @@ if (isSomeChar!Char && isSomeChar!Char2) Params: haystack = String to search for needles in. needles = Strings to search for in haystack. - startIdx = slices haystack like this $(D haystack[startIdx .. $]). If + startIdx = slices haystack like this `haystack[startIdx .. $]`. If the startIdx is greater equal the length of haystack the functions returns $(D -1). cs = Indicates whether the comparisons are case sensitive. @@ -2080,7 +2080,7 @@ if (isSomeChar!Char && isSomeChar!Char2) Params: haystack = String to search for needles in. needles = Strings to search for in haystack. - stopIdx = slices haystack like this $(D haystack[0 .. stopIdx]) If + stopIdx = slices haystack like this `haystack[0 .. stopIdx]` If the stopIdx is greater equal the length of haystack the functions returns $(D -1). cs = Indicates whether the comparisons are case sensitive. diff --git a/std/traits.d b/std/traits.d index 3384707f6c7..95084c66831 100644 --- a/std/traits.d +++ b/std/traits.d @@ -3349,7 +3349,7 @@ template hasElaborateCopyConstructor(S) /** True if $(D S) or any type directly embedded in the representation of $(D S) defines an elaborate assignment. Elaborate assignments are introduced by - defining $(D opAssign(typeof(this))) or $(D opAssign(ref typeof(this))) + defining `opAssign(typeof(this))` or `opAssign(ref typeof(this))` for a $(D struct) or when there is a compiler-generated $(D opAssign). A type $(D S) gets compiler-generated $(D opAssign) in case it has @@ -3554,7 +3554,7 @@ enum hasMember(T, string name) = __traits(hasMember, T, name); } /** -Retrieves the members of an enumerated type $(D enum E). +Retrieves the members of an enumerated type `enum E`. Params: E = An enumerated type. $(D E) may have duplicated values. @@ -4810,7 +4810,7 @@ private struct __InoutWorkaroundStruct{} /** Creates an lvalue or rvalue of type $(D T) for $(D typeof(...)) and -$(D __traits(compiles, ...)) purposes. No actual value is returned. +`__traits(compiles, ...)` purposes. No actual value is returned. Note: Trying to use returned value will result in a "Symbol Undefined" error at link time. @@ -7507,7 +7507,7 @@ template allSameType(T...) /** Returns: $(D true) iff the type $(D T) can be tested in an $(D - if)-expression, that is if $(D if (pred(T.init)) {}) is compilable. + if)-expression, that is if `if (pred(T.init)) {}` is compilable. */ enum ifTestable(T, alias pred = a => a) = __traits(compiles, { if (pred(T.init)) {} }); diff --git a/std/typecons.d b/std/typecons.d index 66c27aa6c78..200422484e7 100644 --- a/std/typecons.d +++ b/std/typecons.d @@ -323,7 +323,7 @@ private template sharedToString(alias field) } /** -_Tuple of values, for example $(D Tuple!(int, string)) is a record that +_Tuple of values, for example `Tuple!(int, string)` is a record that stores an $(D int) and a $(D string). $(D Tuple) can be used to bundle values together, notably when returning multiple values from a function. If $(D obj) is a `Tuple`, the individual members are @@ -1878,7 +1878,7 @@ template Rebindable(T) /** However, $(D Rebindable!(Widget)) does allow reassignment, - while otherwise behaving exactly like a $(D const Widget). + while otherwise behaving exactly like a `const Widget`. */ @system unittest { @@ -2738,9 +2738,9 @@ auto nullable(T)(T t) /** Just like $(D Nullable!T), except that the null state is defined as a -particular value. For example, $(D Nullable!(uint, uint.max)) is an +particular value. For example, `Nullable!(uint, uint.max)` is an $(D uint) that sets aside the value $(D uint.max) to denote a null -state. $(D Nullable!(T, nullValue)) is more storage-efficient than $(D +state. `Nullable!(T, nullValue)` is more storage-efficient than $(D Nullable!T) because it does not need to store an extra $(D bool). Params: @@ -3101,7 +3101,7 @@ auto nullable(alias nullValue, T)(T t) Just like $(D Nullable!T), except that the object refers to a value sitting elsewhere in memory. This makes assignments overwrite the initially assigned value. Internally $(D NullableRef!T) only stores a -pointer to $(D T) (i.e., $(D Nullable!T.sizeof == (T*).sizeof)). +pointer to `T` (i.e., `Nullable!T.sizeof == (T*).sizeof`). */ struct NullableRef(T) { @@ -5321,8 +5321,8 @@ Assignment operators refCountedPayload this;), so callers can just use the $(D RefCounted) object as a $(D T). - $(BLUE The first overload exists only if $(D autoInit == RefCountedAutoInitialize.yes).) - So if $(D autoInit == RefCountedAutoInitialize.no) + $(BLUE The first overload exists only if `autoInit == RefCountedAutoInitialize.yes`.) + So if `autoInit == RefCountedAutoInitialize.no` or called for a constant or immutable object, then $(D refCountedPayload) will also be qualified as safe and nothrow (but will still assert if not initialized). @@ -7352,8 +7352,8 @@ public: // ReplaceType /** Replaces all occurrences of `From` into `To`, in one or more types `T`. For -example, $(D ReplaceType!(int, uint, Tuple!(int, float)[string])) yields -$(D Tuple!(uint, float)[string]). The types in which replacement is performed +example, `ReplaceType!(int, uint, Tuple!(int, float)[string])` yields +`Tuple!(uint, float)[string]`. The types in which replacement is performed may be arbitrarily complex, including qualifiers, built-in type constructors (pointers, arrays, associative arrays, functions, and delegates), and template instantiations; replacement proceeds transitively through the type definition. diff --git a/std/uni.d b/std/uni.d index de05ca70a39..e6b09faa704 100644 --- a/std/uni.d +++ b/std/uni.d @@ -5377,7 +5377,7 @@ if (isCodepointSet!Set) /** $(P Builds a $(D Trie) with typically optimal speed-size trade-off and wraps it into a delegate of the following type: - $(D bool delegate(dchar ch)). ) + `bool delegate(dchar ch)`. ) $(P Effectively this creates a 'tester' lambda suitable for algorithms like std.algorithm.find that take unary predicates. ) @@ -5401,7 +5401,7 @@ if (isCodepointSet!Set) data-structures like trie. ) Note: - $(P The $(D BitPacked!(T, sz)) is implicitly convertible to $(D T) + $(P The `BitPacked!(T, sz)` is implicitly convertible to `T` but not vise-versa. Users have to ensure the value fits in the range required and use the $(D cast) operator to perform the conversion.) diff --git a/std/utf.d b/std/utf.d index f41eeee701a..cbc6be1a11f 100644 --- a/std/utf.d +++ b/std/utf.d @@ -4,7 +4,7 @@ Encode and decode UTF-8, UTF-16 and UTF-32 strings. UTF character support is restricted to - $(D '\u0000' <= character <= '\U0010FFFF'). + `'\u0000' <= character <= '\U0010FFFF'`. See_Also: $(LINK2 http://en.wikipedia.org/wiki/Unicode, Wikipedia)
@@ -259,7 +259,7 @@ pure nothrow @safe @nogc unittest $(D stride) will only analyze the first $(D str[index]) element. It will not fully verify the validity of the UTF sequence, nor even verify the presence of the sequence: it will not actually guarantee that - $(D index + stride(str, index) <= str.length). + `index + stride(str, index) <= str.length`. +/ uint stride(S)(auto ref S str, size_t index) if (is(S : const char[]) || @@ -575,10 +575,10 @@ if (is(S : const dchar[]) || end of a valid UTF sequence. Note: - $(D strideBack) will only analyze the element at $(D str[index - 1]) + `strideBack` will only analyze the element at `str[index - 1]` element. It will not fully verify the validity of the UTF sequence, nor even verify the presence of the sequence: it will not actually - guarantee that $(D strideBack(str, index) <= index). + guarantee that `strideBack(str, index) <= index`. +/ uint strideBack(S)(auto ref S str, size_t index) if (is(S : const char[]) || diff --git a/std/windows/syserror.d b/std/windows/syserror.d index 83de681662a..97cc0fc98d6 100644 --- a/std/windows/syserror.d +++ b/std/windows/syserror.d @@ -48,7 +48,7 @@ version (StdDdoc) /++ If $(D !!value) is true, $(D value) is returned. Otherwise, - $(D new WindowsException(GetLastError(), msg)) is thrown. + `new WindowsException(GetLastError(), msg)` is thrown. $(D WindowsException) assumes that the last operation set $(D GetLastError()) appropriately.