Fetching contributors…
Cannot retrieve contributors at this time
372 lines (315 sloc) 13.1 KB
$(COMMENT Pending changelog for 2.072. This will get copied to and
cleared when master gets merged into stable prior to 2.072.
$(BUGSTITLE Library Changes,
$(LI $(RELATIVE_LINK2 std-digest-murmurhash, Implementation of MurmurHash
$(LI $(RELATIVE_LINK2 process, Process creation in `std.process` was sped up
on Posix.))
$(LI $(RELATIVE_LINK2 std-algorithm-iteration-cumulativeFold,
`algorithm.iteration.cumulativeFold` was added.))
$(LI $(RELATIVE_LINK2 padLeft-padRight, `std.range.padLeft` and
`std.range.padRight` were added.))
$(LI $(RELATIVE_LINK2 regex-multiple-patterns, `std.regex.regex` now
supports matching multiple patterns in one go.))
$(LI $(RELATIVE_LINK2 regex-with-matches, `std.regex.splitter` now
supports keeping the pattern matches in the resulting range.))
$(LI $(RELATIVE_LINK2 optimization, `findLocalMin` was added to `std.numeric`.))
$(LI $(RELATIVE_LINK2 slice_ptr, `ptr` property and public constructor were
added to `std.experimental.ndslice.slice.Slice`.))
$(LI $(RELATIVE_LINK2 slice_alloc, `slice`, `shape`, `ndarray`, and other
utilities were added to `std.experimental.ndslice.slice`.))
$(LI $(RELATIVE_LINK2 slice_iota, `iotaSlice` lazy tensor was added to
$(LI $(RELATIVE_LINK2 slice_mio, partial support for Math Index Order
was added to `std.experimental.ndslice.slice.Slice`.))
$(LI $(RELATIVE_LINK2 mutation, `std.algorithm.mutation.swapAt` was
$(LI $(RELATIVE_LINK2 iota-length-size_t, `std.range.iota's `.length`
property is fixed to `size_t` instead of the type being iterated))
$(LI $(REF isNumber, std,uni) and $(REF isPunctuation, std,uni) now use a separate,
optimized path for ASCII inputs.)
$(LI $(REF isAlphaNum, std,uni), which is analogous to $(REF isAlphaNum, std,ascii)
was added.)
$(LI $(REF regex, std,regex) now supports inline comments with (?#...) syntax.)
$(LI std.regex had numerous optimization applied, compile-time $(REF ctRegex, std,regex)
should now be generally faster then the run-time version.)
$(LI $(REF moveAt, std,range,primitives) accepts only `size_t` for its index
$(LI $(REF isStrictlyMonotonic, std,algorithm,sorting) which doesn't allow
equal values was added.)
$(LI $(REF readLink, std,file) and $(REF symlink, std,file) have been
$(LI All overloads of `std.conv.toImpl` has been made private. Please use
$(REF to, std,conv) instead.)
$(LI $(RELATIVE_LINK2 min-max-element,
`std.algorithm.searching.{min,max}Element` for ranges have been added.))
$(LI $(REF Ternary, std,typecons) was added to represent three valued
$(LI $(RELATIVE_LINK2 quantize, Added `std.math.quantize`, for rounding to
the nearest multiple of some number.))
$(LI $(RELATIVE_LINK2 traits, Three new traits were added to `std.traits`.))
$(LI Wrong
$(LINK2 $(ROOT_DIR)spec/function.html#trusted-functions, `@trusted`)
attributes have been
removed from $(MREF etc,c,curl) functions
$(REF_ALTTEXT `curl_easy_escape`, curl_easy_escape, etc,c,curl),
$(REF_ALTTEXT `curl_escape`, curl_escape, etc,c,curl),
$(REF_ALTTEXT `curl_easy_unescape`, curl_easy_unescape, etc,c,curl), and
$(REF_ALTTEXT `curl_unescape`, curl_unescape, etc,c,curl).)
$(LI $(RELATIVE_LINK2 generate, `std.range.generate` fixed to be a proper
$(LI $(MREF std,numeric) no longer uses `enforce` for verifying
contract preconditions.)
$(LI $(RELATIVE_LINK2 headconst, `Final` was added to
$(BUGSTITLE Library Changes,
$(LI $(LNAME2 std-digest-murmurhash, Implementation of `std.digest.murmurhash`).
$(P $(MREF std,digest,murmurhash) has been added. MurmurHash is a
non-cryptographic hash function suitable for general hash-based lookup. It
is optimized for x86 architectures.
// Computing the 32-bits hash value of an int array using the convenient digest template.
import std.digest.murmurhash;
ubyte[4] hashed = digest!MurmurHash3_32_opt32([1, 2, 3, 4]);
$(LI $(LNAME2 process, Process creation in `std.process` was sped up on Posix.)
$(P Previously, Posix systems would attempt to close every file descriptor
from 3 to the maximum file descriptor number if `inheritFDs` was not
specified with `spawnProcess`, `pipeProcess`, etc.
$(MREF std,process) now uses `poll()` to determine which
descriptors need closing.
$(LI $(LNAME2 std-algorithm-iteration-cumulativeFold,
`algorithm.iteration.cumulativeFold` was added.)
$(P $(REF cumulativeFold, std,algorithm,iteration) returns the successive
reduced values of an input range.)
assert([1, 2, 3, 4, 5].cumulativeFold!((a, b) => a + b).array == [1, 3, 6, 10, 15]);
assert([1, 2, 3].cumulativeFold!((a, b) => a + b)(100).array == [101, 103, 106]);
$(LI $(LNAME2 padLeft-padRight, `std.range.padLeft` and `std.range.padRight`
were added.)
$(P $(REF padLeft, std,range) and $(REF padRight, std,range) are functions for
padding ranges to a specified length using the given element.
import std.range;
import std.algorithm.comparison;
assert([1, 2, 3, 4, 5].padLeft(0, 7).equal([0, 0, 1, 2, 3, 4, 5]));
assert("Hello World!".padRight('!', 15).equal("Hello World!!!!"));
$(LI $(LNAME2 regex-multiple-patterns, `std.regex.regex` now supports matching multiple patterns in one go.)
import std.regex;
// multi-pattern regex
auto multi = regex([`\d+,\d+`,`(a-z]+):(\d+)`]);
auto m = "abc:43 12,34".matchAll(multi);
assert(m.front.whichPattern == 2);
assert(m.front[1] == "abc");
assert(m.front[2] == "43");
assert(m.front.whichPattern == 1);
assert(m.front[1] == "12");
$(LI $(LNAME2 regex-with-matches, `std.regex.splitter` now supports keeping the
pattern matches in the resulting range.)
import std.regex;
import std.algorithm.comparison : equal;
auto pattern = regex(`([\.,])`);
.equal(["2003", "04", "05"]));
.equal(["2003", ".", "04", ".", "05"]));
$(LI $(LNAME2 optimization, `findLocalMin` was added to `std.numeric`.)
$(P $(REF findLocalMin, std,numeric) finds a real minimum of a real function `f(x)` via bracketing.)
import std.numeric, std.math;
auto ret = findLocalMin((double x) => (x-4)^^2, -1e7, 1e7);
$(LI $(LNAME2 slice_ptr, `ptr` property and public constructor were added to
$(P `ptr` property allows to access `Slice`'s underlaying pointer or range.
Please refer to $(REF Slice, std,experimental,ndslice,slice)'s
internal binary epresentation before using the property.
`ptr` property is used in $(LINK2, Mir)
for $(LINK2, sparse tensors).
`ndslice` developer mirror in Mir will be removed as
soon as LDC (LLVM D compiler) supports D version 2.072..
$(P Public constructor for `Slice` was added to support
$(MREF std,experimental,ndslice) integration
with other languages and libraries such as Julia language and NumPy library.
$(LI $(LNAME2 slice_alloc, `slice`, `shape`, `ndarray`, and other utilities
were added to `std.experimental.ndslice.slice`.)
$(P These utility functions have been added to
$(MREF std,experimental,ndslice):)
$(LI $(REF shape, std,experimental,ndslice,slice),)
$(LI $(REF slice, std,experimental,ndslice,slice),)
$(LI $(REF makeSlice, std,experimental,ndslice,slice),)
$(LI $(REF ndarray, std,experimental,ndslice,slice), and)
$(LI $(REF makeNdarray, std,experimental,ndslice,slice).)
$(P Example: Transposing common 2D array using `ndslice`)
import std.experimental.ndslice;
auto ar = [[0, 1, 2], [3, 4, 5]];
auto sh = ar.shape; // [2, 3] type of size_t[2]
auto sl = slice!int(sh); // allocates slice with corresponding shape
sl[] = ar; // fills sl with values from ar
ar = sl.transposed.ndarray; // allocates common 2D array
assert(ar == [[0, 3], [1, 4], [2, 5]]);
$(LI $(LNAME2 slice_iota, `iotaSlice` lazy tensor was added to `std.experimental.ndslice.selection`.)
$(P $(REF iotaSlice, std,experimental,ndslice,selection) is the fastest possible `Slice`.)
import std.experimental.ndslice;
auto sl = iotaSlice([2, 3], 10);
assert(sl.transposed == [[10, 13],
[11, 14],
[12, 15]]);
$(LI $(LNAME2 slice_mio, partial support for Math Index Order was added to `std.experimental.ndslice.slice.Slice`.)
import std.experimental.ndslice;
auto sl = iotaSlice(3, 4);
assert(sl[2, 3] == 11); // D & C index order
assert(sl(3, 2) == 11); // Math & Fortran index order
$(LI $(LNAME2 mutation, `std.algorithm.mutation.swapAt` was exposed)
$(P $(REF swapAt, std,algorithm,mutation) allows to swap elements
of a RandomAccessRange by their indices.
$(LI $(LNAME2 iota-length-size_t, `std.range.iota's `.length` property is fixed
to `size_t` instead of the type being iterated)
$(P $(REF iota, std,range)'s `.length` property is now always returned as
`size_t`. This means if you are on a 32-bit CPU and you are using
iota to iterate 64-bit types, the length will be truncated to `size_t`.
In non-release mode, you will get an exception if the length exceeds
`size_t.max` in your call to `iota`.
$(LI $(LNAME2 min-max-element, `std.algorithm.searching.{min,max}Element`
have been added.)
$(P $(REF minElement, algorithm,searching) and $(REF maxElement,
algorithm,searching) are functions to search for the minimum and maximum
element in a range. They support a custom `map` accessor.
import std.algorithm.searching;
import std.range;
import std.typecons;
assert([3, 1, 4].minElement == 1);
assert([4, 7, 5].enumerate.maxElement!`a.value` == tuple(1, 7));
$(LI $(LNAME2 quantize, Added `std.math.quantize`.)
$(P $(REF quantize, std,math) rounds to the nearest multiple of some number.
$(LI The rounding method can be specified using the `rfunc` parameter. By
default, the current rounding mode will be used, which is typically
"banker's rounding".)
$(LI Overloads are included for the common case of rounding to the $(I Nth)
digit place in some base.)
$(LI If known at compile time, the base and exponent (digit place) can be
supplied as template parameters for better performance.)
import std.math;
assert(12345.6789L.quantize(20.0L) == 12340.0L);
assert(12345.6789L.quantize!(10, -2) == 12345.68L);
assert(12345.6789L.quantize!(10, floor)(-2) == 12345.67L);
$(LI $(LNAME2 traits, Three new traits were added to `std.traits`.)
$(P $(REF isType, std,traits), $(REF isFunction, std,traits), and
$(REF isFinal, std,traits) were added to `std.traits`.
import std.traits;
static assert(isType!int);
struct S {}
class C {}
interface I {}
static assert(isType!S);
static assert(isType!C);
static assert(isType!I);
import std.traits;
void func(){}
struct S
@property int prop(){ return 0; }
static assert(isFunction!func);
static assert(isFunction!(S.prop));
// is a delegate type, not function type
static assert(!isFunction!(typeof(&S.prop)));
import std.traits;
class C
void nf() {}
final void ff() {}
final class FC {}
static assert(!isFinal!(C));
static assert( isFinal!(FC));
static assert(!isFinal!(;
static assert( isFinal!(C.ff));
$(LI $(LNAME2 generate, `std.range.generate` fixed to be a proper range.)
$(P $(REF generate, std, range) was set up to return a different value on each
call to `front`. In addition, `popFront` did nothing. This means that
manipulation functions like $(REF drop, std, range) did nothing. The new
version uses a one-element cache to meet the expectations of the range
definition. It preserves the ref-ness of the generator as well.
$(LI $(LNAME2 headconst, `Final` was added to `std.experimental.typecons`.)
$(P $(REF Final, std, experimental, typecons) can't be mutated directly.
However references are typed with their original mutability. This is
equivalent to `final` in Java or `readonly` in C#.
auto a = makeFinal([1, 2, 3]);
assert(a[0] == 1);
// a = [2, 3]; // Reassignment is illegal,
a[0] = 42; // Elements or fields are still mutable.
assert(a[0] == 42);
TITLE=Change Log
BUGSTITLE = <div class="bugsfixed">$(H4 $1) $(OL $2 )</div>
RELATIVE_LINK2=<a href="#$1">$+</a>
LNAME2=<a class="anchor" title="Permalink to this section" id="$1" href="#$1">$+</a>
BOOKTABLE = <table><caption>$1</caption>$+</table>