forked from dlang/phobos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into stable
- Loading branch information
Showing
143 changed files
with
2,656 additions
and
2,117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The deprecated `std.c` package has been removed. | ||
|
||
Use the `core.stdc` package instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
`std.algorithm.mutation.remove` now only accepts integral values or pair of integral values as offset | ||
|
||
Previously, without being stated in the documentation, | ||
$(REF remove, std,algorithm) used to accept any values as `offset`. | ||
This behavior was very error-prone: | ||
|
||
--- | ||
import std.algorithm, std.stdio; | ||
[0, 1, 2, 3, 4].remove(1, 3).writeln; // 0, 2, 4 -- correct | ||
[0, 1, 2, 3, 4].remove([1, 3]).writeln; // 0, 3, 4 -- incorrect | ||
--- | ||
|
||
With this release, using arrays as individual elements is no longer valid. | ||
$(REF tuple, std,typecons) can be used to explicitly indicate that a range | ||
from `start` to `stop` (non-enclosing) should be removed: | ||
|
||
--- | ||
import std.algorithm, std.stdio, std.typecons; | ||
[0, 1, 2, 3, 4].remove(tuple(1, 3)).writeln; // 0, 3, 4 | ||
--- | ||
|
||
However, only 2-tuples are allowed to avoid this un-intuitive scenario: | ||
|
||
--- | ||
import std.algorithm, std.stdio, std.typecons; | ||
[0, 1, 2, 3, 4].remove(tuple(1, 3, 4)).writeln; // 0, 4? | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Changed semantics of std.math.{fmin,fmax} wrt. NaNs. | ||
|
||
The semantics of $(REF fmin, std, math) and $(REF fmax, std, math) have been | ||
streamlined with the C functions: if one of the arguments is a NaN, return the | ||
other. This involves an additional $(REF isNaN, std, math) check. Use | ||
$(REF min, std, algorithm, comparison) and $(REF max, std, algorithm, comparison) | ||
for the previous semantics performing a single comparison. | ||
|
||
--- | ||
import std.math; | ||
assert(fmin(real.nan, 2.0L) == 2.0L); | ||
assert(fmin(2.0L, real.nan) == 2.0L); // previously: NaN | ||
assert(isNaN(fmin(real.nan, real.nan))); | ||
|
||
import std.algorithm.comparison; | ||
assert(min(real.nan, 2.0L) == 2.0L); | ||
assert(isNaN(min(2.0L, real.nan))); | ||
assert(isNaN(min(real.nan, real.nan))); | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.