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
56 changed files
with
4,889 additions
and
19,941 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
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,15 @@ | ||
Single- and double-precision implementations for log function families | ||
|
||
New `float` and `double` overloads of $(REF log, std, math, exponential), | ||
$(REF log10, std, math, exponential), $(REF log1p, std, math, exponential), | ||
$(REF log2, std, math, exponential), and $(REF logb, std, math, exponential) | ||
have been added to Phobos with proper 'software' implementations in the | ||
corresponding precision. Furthermore, $(REF logb, std, math, exponential) is | ||
now `pure`. | ||
|
||
While this may result in a slowdown in some cases for DMD, the overall speed-up | ||
factor for GDC and LDC is over 3x, for both `double` and `float`. | ||
|
||
This also implies less precise results, especially in single-precision, | ||
so if your code depended on more accurate results via 80-bit intermediate | ||
precision, you'll have to cast the argument(s) explicitly now. |
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,24 @@ | ||
The Unicode property "C" aka "Other" has had the wrong properties associated with it. | ||
|
||
If you use `unicode.c` or `unicode.Other` (case insensitive) from `std.uni`, you should mitigate or fix your codebase. | ||
|
||
This change makes it match the [Unicode Techical Report #44](https://www.unicode.org/reports/tr44/). Unfortunately if you are already using it with its previous wrong values, this will break your code, below is a function which reflects the original values that you can use to mitigate against any breakage. | ||
|
||
--- | ||
@property auto loadPropertyOriginal(string name)() pure | ||
{ | ||
import std.uni : unicode; | ||
|
||
static if (name == "C" || name == "c" || name == "other" || name == "Other") | ||
{ | ||
auto target = unicode.Co; | ||
target |= unicode.Lo; | ||
target |= unicode.No; | ||
target |= unicode.So; | ||
target |= unicode.Po; | ||
return target; | ||
} | ||
else | ||
return unicode.opDispatch!name; | ||
} | ||
--- |
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,5 @@ | ||
Unicode table generator is now in Phobos, tables are updated to version 15. | ||
|
||
It is likely that this change will result in breakage in code and program usage. | ||
This is due to a number of factors, the tables being updated so significantly and the table generator not having all its changes commited throughout the years. | ||
|
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,28 @@ | ||
`std.typecons.Unique` now calls `destroy` on struct types | ||
|
||
When Unique goes out of scope, any destructor will now be called. | ||
Previously the destructor was not called then. | ||
|
||
$(RUNNABLE_EXAMPLE | ||
--- | ||
static int i; | ||
|
||
struct S | ||
{ | ||
~this() | ||
{ | ||
i++; | ||
} | ||
} | ||
{ | ||
Unique!S u = new S; | ||
// S.~this now called here | ||
} | ||
assert(i == 1); | ||
--- | ||
) | ||
|
||
$(B Note:) Above, the struct destructor will also be called by the GC just | ||
before the memory for `new S` is reclaimed. Take care that any struct | ||
destructor used will handle being called again on the struct `.init` | ||
value. |
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
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
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.