aboutsummaryrefslogtreecommitdiff
path: root/libphobos/src
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2025-01-05 13:51:59 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2025-01-05 13:56:23 +0100
commit3dfad340cb140d64b8c0ecab05fa329238ebd06b (patch)
treef1a276a888f41e08b0009943c0e914814bf3f888 /libphobos/src
parent332cf038fda109ea0612eeba7a85441293ba6984 (diff)
downloadgcc-3dfad340cb140d64b8c0ecab05fa329238ebd06b.zip
gcc-3dfad340cb140d64b8c0ecab05fa329238ebd06b.tar.gz
gcc-3dfad340cb140d64b8c0ecab05fa329238ebd06b.tar.bz2
libphobos: Merge upstream druntime c11e1d1708, phobos 303b9c9f7
Synchronizing the library with the upstream release of v2.108.1. D runtime changes: - Import druntime v2.108.1. - Removed all `collectNoStack' functions and API from the garbage collector. - The static method `core.thread.Thread.sleep' is now marked as `@trusted'. Phobos changes: - Import phobos v2.108.1. - Add `std.process.Config.preExecDelegate'. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime c11e1d1708. * libdruntime/Makefile.am (DRUNTIME_DSOURCES_FREEBSD): Add core/sys/freebsd/mqueue.d. (DRUNTIME_DSOURCES_LINUX): Add core/sys/linux/sys/mount.d. * libdruntime/Makefile.in: Regenerate. * src/MERGE: Merge upstream phobos 303b9c9f7. * testsuite/libphobos.exceptions/invalid_memory_operation.d: Adjust test.
Diffstat (limited to 'libphobos/src')
-rw-r--r--libphobos/src/MERGE2
-rw-r--r--libphobos/src/std/algorithm/searching.d72
-rw-r--r--libphobos/src/std/algorithm/setops.d2
-rw-r--r--libphobos/src/std/bitmanip.d11
-rw-r--r--libphobos/src/std/conv.d6
-rw-r--r--libphobos/src/std/csv.d15
-rw-r--r--libphobos/src/std/file.d5
-rw-r--r--libphobos/src/std/internal/math/biguintcore.d25
-rw-r--r--libphobos/src/std/internal/test/range.d91
-rw-r--r--libphobos/src/std/internal/unicode_comp.d24
-rw-r--r--libphobos/src/std/internal/unicode_decomp.d24
-rw-r--r--libphobos/src/std/internal/unicode_grapheme.d84
-rw-r--r--libphobos/src/std/internal/unicode_norm.d48
-rw-r--r--libphobos/src/std/internal/unicode_tables.d220
-rw-r--r--libphobos/src/std/logger/core.d6
-rw-r--r--libphobos/src/std/math/algebraic.d4
-rw-r--r--libphobos/src/std/math/hardware.d4
-rw-r--r--libphobos/src/std/net/isemail.d3
-rw-r--r--libphobos/src/std/path.d8
-rw-r--r--libphobos/src/std/process.d50
-rw-r--r--libphobos/src/std/range/package.d291
-rw-r--r--libphobos/src/std/socket.d10
-rw-r--r--libphobos/src/std/sumtype.d2
-rw-r--r--libphobos/src/std/traits.d11
-rw-r--r--libphobos/src/std/typecons.d2
-rw-r--r--libphobos/src/std/utf.d27
-rw-r--r--libphobos/src/std/uuid.d2
-rw-r--r--libphobos/src/std/variant.d2
28 files changed, 723 insertions, 328 deletions
diff --git a/libphobos/src/MERGE b/libphobos/src/MERGE
index 79cd181..b71e3dd 100644
--- a/libphobos/src/MERGE
+++ b/libphobos/src/MERGE
@@ -1,4 +1,4 @@
-8729740e3221cd6dcccdbbbb12b452d0ee9c1ee1
+303b9c9f7c6457a4f31e7444d5ff0315ba97c704
The first line of this file holds the git revision number of the last
merge done from the dlang/phobos repository.
diff --git a/libphobos/src/std/algorithm/searching.d b/libphobos/src/std/algorithm/searching.d
index 465723c..2d89dea 100644
--- a/libphobos/src/std/algorithm/searching.d
+++ b/libphobos/src/std/algorithm/searching.d
@@ -22,8 +22,9 @@ $(T2 boyerMooreFinder,
$(T2 canFind,
`canFind("hello world", "or")` returns `true`.)
$(T2 count,
- Counts elements that are equal to a specified value or satisfy a
- predicate. `count([1, 2, 1], 1)` returns `2` and
+ Counts all elements or elements matching a predicate, specific element or sub-range.$(BR)
+ `count([1, 2, 1])` returns `3`,
+ `count([1, 2, 1], 1)` returns `2` and
`count!"a < 0"([1, -3, 0])` returns `1`.)
$(T2 countUntil,
`countUntil(a, b)` returns the number of steps taken in `a` to
@@ -605,34 +606,29 @@ if (isNarrowString!R1 && isNarrowString!R2)
// count
/**
-The first version counts the number of elements `x` in `r` for
-which `pred(x, value)` is `true`. `pred` defaults to
+Counts matches of `needle` in `haystack`.
+
+The first overload counts each element `e` in `haystack` for
+which `pred(e, needle)` is `true`. `pred` defaults to
equality. Performs $(BIGOH haystack.length) evaluations of `pred`.
-The second version returns the number of times `needle` occurs in
-`haystack`. Throws an exception if `needle.empty`, as the _count
+The second overload counts the number of times `needle` was matched in
+`haystack`. `pred` compares elements in each range.
+Throws an exception if `needle.empty` is `true`, as the _count
of the empty range in any range would be infinite. Overlapped counts
-are not considered, for example `count("aaa", "aa")` is `1`, not
+are *not* considered, for example `count("aaa", "aa")` is `1`, not
`2`.
-The third version counts the elements for which `pred(x)` is $(D
-true). Performs $(BIGOH haystack.length) evaluations of `pred`.
-
-The fourth version counts the number of elements in a range. It is
-an optimization for the third version: if the given range has the
-`length` property the count is returned right away, otherwise
-performs $(BIGOH haystack.length) to walk the range.
-
Note: Regardless of the overload, `count` will not accept
infinite ranges for `haystack`.
Params:
- pred = The predicate to evaluate.
+ pred = The predicate to compare elements.
haystack = The range to _count.
- needle = The element or sub-range to _count in the `haystack`.
+ needle = The element or sub-range to _count in `haystack`.
Returns:
- The number of positions in the `haystack` for which `pred` returned true.
+ The number of matches in `haystack`.
*/
size_t count(alias pred = "a == b", Range, E)(Range haystack, E needle)
if (isInputRange!Range && !isInfinite!Range &&
@@ -645,21 +641,22 @@ if (isInputRange!Range && !isInfinite!Range &&
///
@safe unittest
{
- import std.uni : toLower;
-
// count elements in range
int[] a = [ 1, 2, 4, 3, 2, 5, 3, 2, 4 ];
- assert(count(a) == 9);
assert(count(a, 2) == 3);
assert(count!("a > b")(a, 2) == 5);
+}
+
+///
+@safe unittest
+{
+ import std.uni : toLower;
// count range in range
assert(count("abcadfabf", "ab") == 2);
assert(count("ababab", "abab") == 1);
assert(count("ababab", "abx") == 0);
// fuzzy count range in range
assert(count!((a, b) => toLower(a) == toLower(b))("AbcAdFaBf", "ab") == 2);
- // count predicate in range
- assert(count!("a > 1")(a) == 8);
}
@safe unittest
@@ -711,7 +708,24 @@ if (isForwardRange!R1 && !isInfinite!R1 &&
}
}
-/// Ditto
+/**
+Counts all elements or elements satisfying a predicate in `haystack`.
+
+The first overload counts each element `e` in `haystack` for which `pred(e)` is $(D
+true). Performs $(BIGOH haystack.length) evaluations of `pred`.
+
+The second overload counts the number of elements in a range.
+If the given range has the `length` property,
+that is returned right away, otherwise
+performs $(BIGOH haystack.length) to walk the range.
+
+Params:
+ pred = Optional predicate to find elements.
+ haystack = The range to _count.
+
+Returns:
+ The number of elements in `haystack` (for which `pred` returned true).
+*/
size_t count(alias pred, R)(R haystack)
if (isInputRange!R && !isInfinite!R &&
is(typeof(unaryFun!pred(haystack.front))))
@@ -723,6 +737,16 @@ if (isInputRange!R && !isInfinite!R &&
return result;
}
+///
+@safe unittest
+{
+ // count elements in range
+ int[] a = [ 1, 2, 4, 3, 2, 5, 3, 2, 4 ];
+ assert(count(a) == 9);
+ // count predicate in range
+ assert(count!("a > 2")(a) == 5);
+}
+
/// Ditto
size_t count(R)(R haystack)
if (isInputRange!R && !isInfinite!R)
diff --git a/libphobos/src/std/algorithm/setops.d b/libphobos/src/std/algorithm/setops.d
index cc6f5b7..363bd16 100644
--- a/libphobos/src/std/algorithm/setops.d
+++ b/libphobos/src/std/algorithm/setops.d
@@ -8,7 +8,7 @@ $(LREF setIntersection), $(LREF setSymmetricDifference) expect a range of sorted
ranges as input.
All algorithms are generalized to accept as input not only sets but also
-$(HTTP https://en.wikipedia.org/wiki/Multiset, multisets). Each algorithm
+$(LINK2 https://en.wikipedia.org/wiki/Multiset, multisets). Each algorithm
documents behaviour in the presence of duplicated inputs.
$(SCRIPT inhibitQuickIndex = 1;)
diff --git a/libphobos/src/std/bitmanip.d b/libphobos/src/std/bitmanip.d
index 61c6c20..de2ff31 100644
--- a/libphobos/src/std/bitmanip.d
+++ b/libphobos/src/std/bitmanip.d
@@ -164,8 +164,7 @@ private template createStorageAndFields(Ts...)
alias StoreType = ulong;
else
{
- import std.conv : to;
- static assert(false, "Field widths must sum to 8, 16, 32, or 64, not " ~ to!string(Size));
+ static assert(false, "Field widths must sum to 8, 16, 32, or 64, not " ~ Size.stringof);
alias StoreType = ulong; // just to avoid another error msg
}
@@ -2959,10 +2958,10 @@ if (__traits(isIntegral, T))
Unqual!T result;
version (LittleEndian)
foreach_reverse (b; array)
- result = cast(Unqual!T) ((result << 8) | b);
+ result = cast() cast(T) ((result << 8) | b);
else
foreach (b; array)
- result = cast(Unqual!T) ((result << 8) | b);
+ result = cast() cast(T) ((result << 8) | b);
return cast(T) result;
}
@@ -2977,7 +2976,7 @@ if (__traits(isIntegral, T))
foreach (i; 0 .. T.sizeof)
{
result[i] = cast(ubyte) tmp;
- tmp = cast(Unqual!T) (tmp >>> 8);
+ tmp = cast() cast(T) (tmp >>> 8);
}
}
else
@@ -2985,7 +2984,7 @@ if (__traits(isIntegral, T))
foreach_reverse (i; 0 .. T.sizeof)
{
result[i] = cast(ubyte) tmp;
- tmp = cast(Unqual!T) (tmp >>> 8);
+ tmp = cast()(T) (tmp >>> 8);
}
}
return result;
diff --git a/libphobos/src/std/conv.d b/libphobos/src/std/conv.d
index 5d02df0..3aa73c6 100644
--- a/libphobos/src/std/conv.d
+++ b/libphobos/src/std/conv.d
@@ -5250,7 +5250,7 @@ if (isIntegral!T && isOutputRange!(W, char))
auto unsigned(T)(T x)
if (isIntegral!T)
{
- return cast(Unqual!(Unsigned!T))x;
+ return cast() cast(Unsigned!T) x;
}
///
@@ -5271,7 +5271,7 @@ if (isSomeChar!T)
{
// All characters are unsigned
static assert(T.min == 0, T.stringof ~ ".min must be zero");
- return cast(Unqual!T) x;
+ return cast() x;
}
@safe unittest
@@ -5328,7 +5328,7 @@ if (isSomeChar!T)
auto signed(T)(T x)
if (isIntegral!T)
{
- return cast(Unqual!(Signed!T))x;
+ return cast() cast(Signed!T) x;
}
///
diff --git a/libphobos/src/std/csv.d b/libphobos/src/std/csv.d
index 7f5c2b2..9ee9b5d 100644
--- a/libphobos/src/std/csv.d
+++ b/libphobos/src/std/csv.d
@@ -175,6 +175,16 @@ class CSVException : Exception
assert(ex.toString == "(Row: 1, Col: 2) Unexpected 'b' when converting from type string to type int");
}
+// https://issues.dlang.org/show_bug.cgi?id=24478
+@safe unittest
+{
+ import std.exception : collectException;
+ import std.algorithm.searching : count;
+ string text = "A, B\n1, 2, 3";
+ auto ex = collectException!CSVException(csvReader!(string[string])(text, null).count);
+ assert(ex.toString == "(Row: 1, Col: 3) row contains more values than header");
+}
+
@safe pure unittest
{
import std.string;
@@ -1179,7 +1189,10 @@ public:
{
for (; !recordRange.empty; recordRange.popFront())
{
- aa[header[_input.col-1]] = recordRange.front;
+ const i = _input.col - 1;
+ if (i >= header.length)
+ throw new CSVException("row contains more values than header", _input.row, _input.col);
+ aa[header[i]] = recordRange.front;
}
}
catch (ConvException e)
diff --git a/libphobos/src/std/file.d b/libphobos/src/std/file.d
index 5b8925d..1db779b 100644
--- a/libphobos/src/std/file.d
+++ b/libphobos/src/std/file.d
@@ -1083,6 +1083,7 @@ private void removeImpl(scope const(char)[] name, scope const(FSChar)* namez) @t
@safe unittest
{
import std.exception : collectExceptionMsg, assertThrown;
+ import std.algorithm.searching : startsWith;
string filename = null; // e.g. as returned by File.tmpfile.name
@@ -1090,12 +1091,10 @@ private void removeImpl(scope const(char)[] name, scope const(FSChar)* namez) @t
{
// exact exception message is OS-dependent
auto msg = filename.remove.collectExceptionMsg!FileException;
- assert("Failed to remove file (null): Bad address" == msg, msg);
+ assert(msg.startsWith("Failed to remove file (null):"), msg);
}
else version (Windows)
{
- import std.algorithm.searching : startsWith;
-
// don't test exact message on windows, it's language dependent
auto msg = filename.remove.collectExceptionMsg!FileException;
assert(msg.startsWith("(null):"), msg);
diff --git a/libphobos/src/std/internal/math/biguintcore.d b/libphobos/src/std/internal/math/biguintcore.d
index d5c4768..9df6bb2 100644
--- a/libphobos/src/std/internal/math/biguintcore.d
+++ b/libphobos/src/std/internal/math/biguintcore.d
@@ -2241,31 +2241,6 @@ do
return carry;
}
-// result = left - right
-// returns carry (0 or 1)
-BigDigit subSimple(BigDigit [] result,const(BigDigit) [] left,
- const(BigDigit) [] right) pure nothrow
-in
-{
- assert(result.length == left.length,
- "result and left must be of the same length");
- assert(left.length >= right.length,
- "left must be longer or of equal length to right");
- assert(right.length > 0, "right must not be empty");
-}
-do
-{
- BigDigit carry = multibyteSub(result[0 .. right.length],
- left[0 .. right.length], right, 0);
- if (right.length < left.length)
- {
- result[right.length .. left.length] = left[right.length .. $];
- carry = multibyteIncrementAssign!('-')(result[right.length..$], carry);
- } //else if (result.length == left.length+1) { result[$-1] = carry; carry=0; }
- return carry;
-}
-
-
/* result = result - right
* Returns carry = 1 if result was less than right.
*/
diff --git a/libphobos/src/std/internal/test/range.d b/libphobos/src/std/internal/test/range.d
index 6aa9676..4a5ff72 100644
--- a/libphobos/src/std/internal/test/range.d
+++ b/libphobos/src/std/internal/test/range.d
@@ -23,3 +23,94 @@ module std.internal.test.range;
auto r = R().chunks(3);
assert(r.equal!equal([[ 0, 1, 2 ], [ 3, 4 ]]));
}
+
+// https://issues.dlang.org/show_bug.cgi?id=24415
+@safe unittest
+{
+ import std.range : only;
+
+ static struct S(T)
+ {
+ T i;
+
+ this(ref return scope inout(S) rhs) scope @safe inout pure nothrow
+ {
+ i = rhs.i;
+ }
+ }
+ {
+ auto a = only(S!int(42));
+ auto b = a;
+ assert(!b.empty);
+ assert(b.front == S!int(42));
+
+ a.popFront();
+ auto c = a;
+ assert(c.empty);
+ }
+ {
+ auto a = only(S!(const int)(42));
+ auto b = a;
+ assert(!b.empty);
+ assert(b.front == S!(const int)(42));
+
+ a.popFront();
+ auto c = a;
+ assert(c.empty);
+ }
+ {
+ auto a = only(S!(immutable int)(42));
+ auto b = a;
+ assert(!b.empty);
+ assert(b.front == S!(immutable int)(42));
+
+ a.popFront();
+ auto c = a;
+ assert(c.empty);
+ }
+ {
+ auto a = only(S!int(42), S!int(192));
+ auto b = a;
+ assert(!b.empty);
+ assert(b.front == S!int(42));
+
+ a.popFront();
+ auto c = a;
+ assert(!c.empty);
+ assert(c.front == S!int(192));
+
+ a.popFront();
+ auto d = a;
+ assert(d.empty);
+ }
+ {
+ auto a = only(S!(const int)(42), S!(const int)(192));
+ auto b = a;
+ assert(!b.empty);
+ assert(b.front == S!(const int)(42));
+
+ a.popFront();
+ auto c = a;
+ assert(!c.empty);
+ assert(c.front == S!(const int)(192));
+
+ a.popFront();
+ auto d = a;
+ assert(d.empty);
+ }
+ {
+ auto a = only(S!(immutable int)(42), S!(immutable int)(192));
+ auto b = a;
+ assert(!b.empty);
+ assert(b.front == S!(immutable int)(42));
+
+ a.popFront();
+ auto c = a;
+ assert(!c.empty);
+ assert(c.front == S!(immutable int)(192));
+
+ a.popFront();
+ auto d = a;
+ assert(d.empty);
+ }
+}
diff --git a/libphobos/src/std/internal/unicode_comp.d b/libphobos/src/std/internal/unicode_comp.d
index 646aeeb..28b2e0d 100644
--- a/libphobos/src/std/internal/unicode_comp.d
+++ b/libphobos/src/std/internal/unicode_comp.d
@@ -7,11 +7,11 @@ import std.internal.unicode_tables;
static if (size_t.sizeof == 4)
{
//10144 bytes
-enum combiningClassTrieEntries = TrieEntry!(ubyte, 8, 8, 5)(cast(immutable size_t[]) x"
+enum combiningClassTrieEntries = TrieEntry!(ubyte, 8, 8, 5)(x"
0000000000000040000005C0",
-cast(immutable size_t[]) x"
+x"
0000010000000B00000010A0",
-cast(immutable size_t[]) x"
+x"
020201000402030206020205090807020000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -226,11 +226,11 @@ E600E6E6E6E600E600E6E6E600000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000",
);
enum composeIdxMask = (1 << 11) - 1, composeCntShift = 11;
-enum compositionJumpTrieEntries = TrieEntry!(ushort, 12, 9)(cast(immutable size_t[]) x"
+enum compositionJumpTrieEntries = TrieEntry!(ushort, 12, 9)(x"
0000000000000800",
-cast(immutable size_t[]) x"
+x"
0000100000002600",
-cast(immutable size_t[]) x"
+x"
00010000000300020005000400070006000700080007000700090007000A0007000C000B000700070007000700070007
0007000D0007000700070007000700070007000700070007000700070007000700070007000700070007000700070007
000700070007000700070007000700070007000700070007000700070007000700070007000700070007000700070007
@@ -919,11 +919,11 @@ return t[];
static if (size_t.sizeof == 8)
{
//10144 bytes
-enum combiningClassTrieEntries = TrieEntry!(ubyte, 8, 8, 5)(cast(immutable size_t[]) x"
+enum combiningClassTrieEntries = TrieEntry!(ubyte, 8, 8, 5)(x"
0000000000000000000000000000002000000000000002E0",
-cast(immutable size_t[]) x"
+x"
00000000000001000000000000000B0000000000000010A0",
-cast(immutable size_t[]) x"
+x"
040203020202010009080702060202050000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -1138,11 +1138,11 @@ E6E6E6E600000000000000000007E6E6000000000000000000000000000000000000000000000000
00000000000000000000000000000000",
);
enum composeIdxMask = (1 << 11) - 1, composeCntShift = 11;
-enum compositionJumpTrieEntries = TrieEntry!(ushort, 12, 9)(cast(immutable size_t[]) x"
+enum compositionJumpTrieEntries = TrieEntry!(ushort, 12, 9)(x"
00000000000000000000000000000400",
-cast(immutable size_t[]) x"
+x"
00000000000010000000000000002600",
-cast(immutable size_t[]) x"
+x"
000300020001000000070006000500040007000700070008000A00070009000700070007000C000B0007000700070007
000700070007000D00070007000700070007000700070007000700070007000700070007000700070007000700070007
000700070007000700070007000700070007000700070007000700070007000700070007000700070007000700070007
diff --git a/libphobos/src/std/internal/unicode_decomp.d b/libphobos/src/std/internal/unicode_decomp.d
index 6016f3d..d596d48 100644
--- a/libphobos/src/std/internal/unicode_decomp.d
+++ b/libphobos/src/std/internal/unicode_decomp.d
@@ -19,11 +19,11 @@ import std.internal.unicode_tables;
static if (size_t.sizeof == 4)
{
//23488 bytes
-enum compatMappingTrieEntries = TrieEntry!(ushort, 8, 8, 5)(cast(immutable size_t[]) x"
+enum compatMappingTrieEntries = TrieEntry!(ushort, 8, 8, 5)(x"
000000000000004000000540",
-cast(immutable size_t[]) x"
+x"
0000010000000A0000002360",
-cast(immutable size_t[]) x"
+x"
020201000402030202020205070602020202020208020202000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -516,11 +516,11 @@ cast(immutable size_t[]) x"
00000000000000000000000000000000",
);
//12544 bytes
-enum canonMappingTrieEntries = TrieEntry!(ushort, 8, 8, 5)(cast(immutable size_t[]) x"
+enum canonMappingTrieEntries = TrieEntry!(ushort, 8, 8, 5)(x"
000000000000004000000440",
-cast(immutable size_t[]) x"
+x"
000001000000080000001000",
-cast(immutable size_t[]) x"
+x"
020201000302020202020204020502020202020206020202000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -1636,11 +1636,11 @@ return t[];
static if (size_t.sizeof == 8)
{
//23488 bytes
-enum compatMappingTrieEntries = TrieEntry!(ushort, 8, 8, 5)(cast(immutable size_t[]) x"
+enum compatMappingTrieEntries = TrieEntry!(ushort, 8, 8, 5)(x"
0000000000000000000000000000002000000000000002A0",
-cast(immutable size_t[]) x"
+x"
00000000000001000000000000000A000000000000002360",
-cast(immutable size_t[]) x"
+x"
040203020202010007060202020202050802020202020202000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -2133,11 +2133,11 @@ cast(immutable size_t[]) x"
00000000000000000000000000000000",
);
//12544 bytes
-enum canonMappingTrieEntries = TrieEntry!(ushort, 8, 8, 5)(cast(immutable size_t[]) x"
+enum canonMappingTrieEntries = TrieEntry!(ushort, 8, 8, 5)(x"
000000000000000000000000000000200000000000000220",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000008000000000000001000",
-cast(immutable size_t[]) x"
+x"
030202020202010002050202020202040602020202020202000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
diff --git a/libphobos/src/std/internal/unicode_grapheme.d b/libphobos/src/std/internal/unicode_grapheme.d
index d33e987..ba80e18 100644
--- a/libphobos/src/std/internal/unicode_grapheme.d
+++ b/libphobos/src/std/internal/unicode_grapheme.d
@@ -19,11 +19,11 @@ package(std):
static if (size_t.sizeof == 4)
{
//832 bytes
-enum hangulLVTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum hangulLVTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000004000000080",
-cast(immutable size_t[]) x"
+x"
000001000000008000000A00",
-cast(immutable size_t[]) x"
+x"
000000000002010000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -44,11 +44,11 @@ cast(immutable size_t[]) x"
00000000000000000000000000000000",
);
//832 bytes
-enum hangulLVTTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum hangulLVTTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000004000000080",
-cast(immutable size_t[]) x"
+x"
000001000000008000000A00",
-cast(immutable size_t[]) x"
+x"
000000000002010000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -69,11 +69,11 @@ FEFFFFFFFFEFFFFFFFFEFFFFFFFFEFFFFFFFFEFF0000000F00000000000000000000000000000000
00000000000000000000000000000000",
);
//896 bytes
-enum prependTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum prependTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000004000000080",
-cast(immutable size_t[]) x"
+x"
000001000000008000000C00",
-cast(immutable size_t[]) x"
+x"
010101000101010101010102010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010000000000000000
@@ -95,11 +95,11 @@ cast(immutable size_t[]) x"
0000000000000000000000000000000000000000000000000000000000000000",
);
//1280 bytes
-enum controlTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum controlTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000040000000D0",
-cast(immutable size_t[]) x"
+x"
000001000000012000000E00",
-cast(immutable size_t[]) x"
+x"
020201000302020202020402020605020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020702020202020202020202020202020202020202020000000000000000
@@ -129,11 +129,11 @@ FFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000
0000000000000000000000000000000000000000000000000000000000000000",
);
//1856 bytes
-enum spacingMarkTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum spacingMarkTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000040000000B0",
-cast(immutable size_t[]) x"
+x"
00000100000000E000002400",
-cast(immutable size_t[]) x"
+x"
010101000101020104010103010501010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010000000000000000
@@ -175,11 +175,11 @@ cast(immutable size_t[]) x"
0000000000000000000000000000000000000000000000000000000000000000",
);
//3488 bytes
-enum graphemeExtendTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum graphemeExtendTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000004000000110",
-cast(immutable size_t[]) x"
+x"
00000100000001A000004B00",
-cast(immutable size_t[]) x"
+x"
0202010004020302070206050A0908020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020B02020202020202020202020202020202020202020000000000000000
@@ -255,11 +255,11 @@ FFFFFFFFF87FFFFFFFFFFFFF00201FFFF80000100000FFFE0000000000000000F9FFFF7F000007DB
0000000000000000000000000000000000000000000000000000000000000000",
);
//1344 bytes
-enum Extended_PictographicTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum Extended_PictographicTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000004000000090",
-cast(immutable size_t[]) x"
+x"
00000100000000A000001800",
-cast(immutable size_t[]) x"
+x"
020201000202020202020202030202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -296,11 +296,11 @@ FFFFFFFFFFFFFFFFFFFFFFFF3FFFFFFF000000000000000000000000000000000000000000000000
static if (size_t.sizeof == 8)
{
//832 bytes
-enum hangulLVTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum hangulLVTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000040",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000000800000000000000A00",
-cast(immutable size_t[]) x"
+x"
000201000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -321,11 +321,11 @@ cast(immutable size_t[]) x"
00000000000000000000000000000000",
);
//832 bytes
-enum hangulLVTTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum hangulLVTTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000040",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000000800000000000000A00",
-cast(immutable size_t[]) x"
+x"
000201000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -346,11 +346,11 @@ FFEFFFFFFEFFFFFFFFFFEFFFFFFEFFFF0000000FFFFFFEFF00000000000000000000000000000000
00000000000000000000000000000000",
);
//896 bytes
-enum prependTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum prependTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000040",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000000800000000000000C00",
-cast(immutable size_t[]) x"
+x"
010101010101010001010101010101020101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010000000000000000
@@ -372,11 +372,11 @@ cast(immutable size_t[]) x"
0000000000000000000000000000000000000000000000000000000000000000",
);
//1280 bytes
-enum controlTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum controlTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000068",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000001200000000000000E00",
-cast(immutable size_t[]) x"
+x"
030202020202010002060502020204020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020207020202020202020202020202020202020000000000000000
@@ -406,11 +406,11 @@ FFFF0000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000",
);
//1856 bytes
-enum spacingMarkTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum spacingMarkTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000058",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000000E00000000000002400",
-cast(immutable size_t[]) x"
+x"
010102010101010001050101040101030101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010000000000000000
@@ -452,11 +452,11 @@ C0300000000000080000000000000002000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000",
);
//3488 bytes
-enum graphemeExtendTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum graphemeExtendTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000088",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000001A00000000000004B00",
-cast(immutable size_t[]) x"
+x"
04020302020201000A090802070206050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
02020202020202020202020202020202020202020202020B020202020202020202020202020202020000000000000000
@@ -532,11 +532,11 @@ F87FFFFFFFFFFFFF00201FFFFFFFFFFF0000FFFEF80000100000000000000000000007DBF9FFFF7F
0000000000000000000000000000000000000000000000000000000000000000",
);
//1344 bytes
-enum Extended_PictographicTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum Extended_PictographicTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000048",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000000A00000000000001800",
-cast(immutable size_t[]) x"
+x"
020202020202010003020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
diff --git a/libphobos/src/std/internal/unicode_norm.d b/libphobos/src/std/internal/unicode_norm.d
index c103c25..bc51c8c 100644
--- a/libphobos/src/std/internal/unicode_norm.d
+++ b/libphobos/src/std/internal/unicode_norm.d
@@ -19,11 +19,11 @@ package(std):
static if (size_t.sizeof == 4)
{
//1728 bytes
-enum nfcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum nfcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000040000000C0",
-cast(immutable size_t[]) x"
+x"
000001000000010000001E00",
-cast(immutable size_t[]) x"
+x"
020201000302020202020204020502020202020206020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -62,11 +62,11 @@ FFFFFFFFFFFFFFFF03FFFFFF00000000A00000005F7FFC0000007FDB000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
);
//2048 bytes
-enum nfdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum nfdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000040000000E0",
-cast(immutable size_t[]) x"
+x"
000001000000014000002400",
-cast(immutable size_t[]) x"
+x"
020201000504030202020206020702020202020208020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -112,11 +112,11 @@ A00000005F7FFC0000007FDB00000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000",
);
//2848 bytes
-enum nfkcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum nfkcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000040000000E0",
-cast(immutable size_t[]) x"
+x"
000001000000014000003D00",
-cast(immutable size_t[]) x"
+x"
020201000402030202020205070602020202020208020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -179,11 +179,11 @@ FFFF07FFFFFF7FFF0000FFFF00001C0000010000000000000000000000000000FFFF00070FFFFFFF
00000000000000000000000000000000",
);
//2944 bytes
-enum nfkdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum nfkdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000040000000F0",
-cast(immutable size_t[]) x"
+x"
000001000000016000003E00",
-cast(immutable size_t[]) x"
+x"
020201000504030202020206080702020202020209020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -254,11 +254,11 @@ FFFF07FFFFFF7FFF0000FFFF00001C0000010000000000000000000000000000FFFF00070FFFFFFF
static if (size_t.sizeof == 8)
{
//1728 bytes
-enum nfcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum nfcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000060",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000001000000000000001E00",
-cast(immutable size_t[]) x"
+x"
030202020202010002050202020202040602020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -297,11 +297,11 @@ FFFFFFFFFFFFFFFF0000000003FFFFFF5F7FFC00A00000000000000000007FDB0000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
);
//2048 bytes
-enum nfdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum nfdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000070",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000001400000000000002400",
-cast(immutable size_t[]) x"
+x"
050403020202010002070202020202060802020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -347,11 +347,11 @@ F8000000000000000000000000000001000000003FFFFFFF00000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000",
);
//2848 bytes
-enum nfkcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum nfkcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000070",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000001400000000000003D00",
-cast(immutable size_t[]) x"
+x"
040203020202010007060202020202050802020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -414,11 +414,11 @@ FFFF7FFFFFFF07FF00001C000000FFFF000000000001000000000000000000000FFFFFFFFFFF0007
00000000000000000000000000000000",
);
//2944 bytes
-enum nfkdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum nfkdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000078",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000001600000000000003E00",
-cast(immutable size_t[]) x"
+x"
050403020202010008070202020202060902020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
diff --git a/libphobos/src/std/internal/unicode_tables.d b/libphobos/src/std/internal/unicode_tables.d
index cc0225b..a686e38 100644
--- a/libphobos/src/std/internal/unicode_tables.d
+++ b/libphobos/src/std/internal/unicode_tables.d
@@ -75,7 +75,7 @@ struct TrieEntry(T...)
SCE simpleCaseTable(size_t i)
{
-static immutable uint[] t = cast(immutable uint[]) x"
+static immutable uint[] t = x"
0201E90B0211E92D0201E9110211E93302000496021004970200A7220210A72302001F7902101FF902001F4402101F4C
0200015A0210015B020010FD02101CBD02016E4C02116E6C02001E3802101E390201E9210211E94302001F2302101F2B
020001A0021001A1030003A3031003C2032003C3020004DC021004DD02002CA602102CA70200017B0210017C0201E906
@@ -329,7 +329,7 @@ return SCE(t[i]);
}
@property FCE fullCaseTable(size_t index) nothrow @nogc @safe pure
{
-static immutable ulong[] t = cast(immutable ulong[]) x"
+static immutable ulong[] t = x"
001E90B000000021001E92D0000001210010CAE0000000210010CEE00000012100004960000000210000497000000121
001E911000000021001E933000000121000A722000000021000A7230000001210001F790000000210001FF9000000121
0001F440000000210001F4C000000121000015A000000021000015B00000012100010FD0000000210001CBD000000121
@@ -2285,11 +2285,11 @@ bool isHangT(dchar ch) @safe pure nothrow @nogc
static if (size_t.sizeof == 4)
{
//2080 bytes
-enum lowerCaseTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum lowerCaseTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000040000000E0",
-cast(immutable size_t[]) x"
+x"
000001000000014000002500",
-cast(immutable size_t[]) x"
+x"
020201000402030206020205080702020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -2336,11 +2336,11 @@ FFFFFFC0FC000000000FFFFFFFFFC000000000FF0FFFFFFCFFC000000000FFFFFFFFFC000000003F
00000000000000000000000000000000",
);
//1856 bytes
-enum upperCaseTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum upperCaseTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000040000000E0",
-cast(immutable size_t[]) x"
+x"
000001000000014000001E00",
-cast(immutable size_t[]) x"
+x"
020201000402030206020205080702020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -2382,11 +2382,11 @@ F0000000001FFFFFFFC0000000007FFFFFFF0000000001FF0000040000000000FFFFFFFF00000003
0000000000000000000000000000000000000000000000000000000000000000",
);
//11648 bytes
-enum simpleCaseTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum simpleCaseTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000004000000280",
-cast(immutable size_t[]) x"
+x"
0000010000000480000011C0",
-cast(immutable size_t[]) x"
+x"
020201000402030206020205070202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -2632,11 +2632,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//11648 bytes
-enum fullCaseTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum fullCaseTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000004000000280",
-cast(immutable size_t[]) x"
+x"
0000010000000480000011C0",
-cast(immutable size_t[]) x"
+x"
020201000402030206020205070202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -2882,11 +2882,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//5600 bytes
-enum alphaTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum alphaTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000040000001A0",
-cast(immutable size_t[]) x"
+x"
00000100000002C000007B00",
-cast(immutable size_t[]) x"
+x"
03020100060504030A0908070E0D0C0B0303030311100F03141413121414141414141414141414141414141414141414
141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414
141414141414141414141414141414141414141414141414141414141414141414141414141414140000000000000000
@@ -3006,11 +3006,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF
0000000000000000000000000000000000000000000000000000000000000000",
);
//3392 bytes
-enum markTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum markTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000004000000110",
-cast(immutable size_t[]) x"
+x"
00000100000001A000004800",
-cast(immutable size_t[]) x"
+x"
0202010004020302070206050A0908020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020B02020202020202020202020202020202020202020000000000000000
@@ -3084,11 +3084,11 @@ F9FFFF7F000007DB0000000000000000000080000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000",
);
//2848 bytes
-enum numberTrieEntries = TrieEntry!(bool, 8, 6, 7)(cast(immutable size_t[]) x"
+enum numberTrieEntries = TrieEntry!(bool, 8, 6, 7)(x"
0000000000000040000001A0",
-cast(immutable size_t[]) x"
+x"
00000100000002C000002500",
-cast(immutable size_t[]) x"
+x"
020201000402030207020605090802020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -3151,11 +3151,11 @@ FFFFFFFF001EEFFF0000000000000000FFFFFFFE3FFFBFFF000000000000000000001FFF00000000
00000000000000000000000003FF0000",
);
//3360 bytes
-enum punctuationTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum punctuationTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000004000000100",
-cast(immutable size_t[]) x"
+x"
000001000000018000004900",
-cast(immutable size_t[]) x"
+x"
0202010004020302070206050A0908020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -3228,11 +3228,11 @@ E8003600000000000000000000003C000000000000000000001000000000000000003FFF00000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
);
//3424 bytes
-enum symbolTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum symbolTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000004000000100",
-cast(immutable size_t[]) x"
+x"
000001000000018000004B00",
-cast(immutable size_t[]) x"
+x"
0302010005030403070303060A0908030303030303030303030303030303030303030303030303030303030303030303
030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303
030303030303030303030303030303030303030303030303030303030303030303030303030303030000000000000000
@@ -3307,11 +3307,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFF000007FF000000000000000000000000
00000000000000000000000000000000",
);
//6080 bytes
-enum graphicalTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum graphicalTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000040000001A0",
-cast(immutable size_t[]) x"
+x"
00000100000002C000008A00",
-cast(immutable size_t[]) x"
+x"
0202010005040302090807060D0C0B0A02020202100F0E02131312111313131313131313131313131313131313131313
131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313
131313131313131313131313131313131313131413131313131313131313131313131313131313130000000000000000
@@ -3441,11 +3441,11 @@ FFFFFFFF0000FFFF0000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
0000000000000000000000000000000000000000000000000000000000000000",
);
//4824 bytes
-enum nonCharacterTrieEntries = TrieEntry!(bool, 7, 4, 4, 6)(cast(immutable size_t[]) x"
+enum nonCharacterTrieEntries = TrieEntry!(bool, 7, 4, 4, 6)(x"
00000000000000200000009800000298",
-cast(immutable size_t[]) x"
+x"
00000080000000F000000400000043C0",
-cast(immutable size_t[]) x"
+x"
0302010007060504090801010B0B0B0A0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B
0B0B0B0B0B0B0B0B0B0B0B0C0D0101010D01010100000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000010000000300020005000400070006
@@ -3552,11 +3552,11 @@ enum MAX_SIMPLE_LOWER = 1433;
enum MAX_SIMPLE_UPPER = 1450;
enum MAX_SIMPLE_TITLE = 1454;
//10496 bytes
-enum toUpperIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toUpperIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000004000000280",
-cast(immutable size_t[]) x"
+x"
000001000000048000000F80",
-cast(immutable size_t[]) x"
+x"
020201000402030206020205070202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -3778,11 +3778,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//10112 bytes
-enum toLowerIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toLowerIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000004000000280",
-cast(immutable size_t[]) x"
+x"
000001000000048000000EC0",
-cast(immutable size_t[]) x"
+x"
020201000402030206020205070202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -3996,11 +3996,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//10496 bytes
-enum toTitleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toTitleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000004000000280",
-cast(immutable size_t[]) x"
+x"
000001000000048000000F80",
-cast(immutable size_t[]) x"
+x"
020201000402030206020205070202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -4222,11 +4222,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//10368 bytes
-enum toUpperSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toUpperSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000004000000280",
-cast(immutable size_t[]) x"
+x"
000001000000048000000F40",
-cast(immutable size_t[]) x"
+x"
020201000402030206020205070202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -4445,11 +4445,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//9856 bytes
-enum toLowerSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toLowerSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000004000000280",
-cast(immutable size_t[]) x"
+x"
000001000000048000000E40",
-cast(immutable size_t[]) x"
+x"
020201000402030206020205070202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -4658,11 +4658,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//10368 bytes
-enum toTitleSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toTitleSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000004000000280",
-cast(immutable size_t[]) x"
+x"
000001000000048000000F40",
-cast(immutable size_t[]) x"
+x"
020201000402030206020205070202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -4882,7 +4882,7 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
);
immutable(uint)[] toUpperTable() nothrow @nogc pure @safe {
static immutable uint[] t =
-cast(immutable uint[]) x"
+x"
0000004100000042000000430000004400000045000000460000004700000048000000490000004A0000004B0000004C
0000004D0000004E0000004F000000500000005100000052000000530000005400000055000000560000005700000058
000000590000005A0000039C000000C0000000C1000000C2000000C3000000C4000000C5000000C6000000C7000000C8
@@ -5027,7 +5027,7 @@ return t;
}
immutable(uint)[] toLowerTable() nothrow @nogc pure @safe {
static immutable uint[] t =
-cast(immutable uint[]) x"
+x"
0000006100000062000000630000006400000065000000660000006700000068000000690000006A0000006B0000006C
0000006D0000006E0000006F000000700000007100000072000000730000007400000075000000760000007700000078
000000790000007A000000E0000000E1000000E2000000E3000000E4000000E5000000E6000000E7000000E8000000E9
@@ -5161,7 +5161,7 @@ return t;
}
immutable(uint)[] toTitleTable() nothrow @nogc pure @safe {
static immutable uint[] t =
-cast(immutable uint[]) x"
+x"
0000004100000042000000430000004400000045000000460000004700000048000000490000004A0000004B0000004C
0000004D0000004E0000004F000000500000005100000052000000530000005400000055000000560000005700000058
000000590000005A0000039C000000C0000000C1000000C2000000C3000000C4000000C5000000C6000000C7000000C8
@@ -5307,11 +5307,11 @@ return t;
static if (size_t.sizeof == 8)
{
//2080 bytes
-enum lowerCaseTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum lowerCaseTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000070",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000001400000000000002500",
-cast(immutable size_t[]) x"
+x"
040203020202010008070202060202050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -5358,11 +5358,11 @@ FFFFFFFC00000000000000000000000F000000000000000000000000000000000000000000000000
00000000000000000000000000000000",
);
//1856 bytes
-enum upperCaseTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum upperCaseTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000070",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000001400000000000001E00",
-cast(immutable size_t[]) x"
+x"
040203020202010008070202060202050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -5404,11 +5404,11 @@ FFF0000003FFFFFFFFFFFF0000003FFF003FDE64D0000003000003FFFFFF00007B0000001FDFE7B0
0000000000000000000000000000000000000000000000000000000000000000",
);
//11648 bytes
-enum simpleCaseTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum simpleCaseTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000000000000000000000200000000000000140",
-cast(immutable size_t[]) x"
+x"
0000000000000100000000000000048000000000000011C0",
-cast(immutable size_t[]) x"
+x"
040203020202010007020202060202050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -5654,11 +5654,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//11648 bytes
-enum fullCaseTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum fullCaseTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000000000000000000000200000000000000140",
-cast(immutable size_t[]) x"
+x"
0000000000000100000000000000048000000000000011C0",
-cast(immutable size_t[]) x"
+x"
040203020202010007020202060202050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -5904,11 +5904,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//5600 bytes
-enum alphaTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum alphaTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000000000000000000002000000000000000D0",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000002C00000000000007B00",
-cast(immutable size_t[]) x"
+x"
06050403030201000E0D0C0B0A09080711100F0303030303141414141414131214141414141414141414141414141414
141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414
141414141414141414141414141414141414141414141414141414141414141414141414141414140000000000000000
@@ -6028,11 +6028,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFF
0000000000000000000000000000000000000000000000000000000000000000",
);
//3392 bytes
-enum markTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum markTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000088",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000001A00000000000004800",
-cast(immutable size_t[]) x"
+x"
04020302020201000A090802070206050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
02020202020202020202020202020202020202020202020B020202020202020202020202020202020000000000000000
@@ -6106,11 +6106,11 @@ B47E00000000000000000000000000BF0000000000FB7C0000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000",
);
//2848 bytes
-enum numberTrieEntries = TrieEntry!(bool, 8, 6, 7)(cast(immutable size_t[]) x"
+enum numberTrieEntries = TrieEntry!(bool, 8, 6, 7)(x"
0000000000000000000000000000002000000000000000D0",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000002C00000000000002500",
-cast(immutable size_t[]) x"
+x"
040203020202010009080202070206050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -6173,11 +6173,11 @@ FFFE0000000003FF0000000000000000000003FF000000000000000000000000003F000000000000
000000000000000003FF000000000000",
);
//3360 bytes
-enum punctuationTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum punctuationTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000080",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000001800000000000004900",
-cast(immutable size_t[]) x"
+x"
04020302020201000A090802070206050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000
@@ -6250,11 +6250,11 @@ FE000000000000000000000000000000000000001E00000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
);
//3424 bytes
-enum symbolTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum symbolTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
000000000000000000000000000000200000000000000080",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000001800000000000004B00",
-cast(immutable size_t[]) x"
+x"
05030403030201000A090803070303060303030303030303030303030303030303030303030303030303030303030303
030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303
030303030303030303030303030303030303030303030303030303030303030303030303030303030000000000000000
@@ -6329,11 +6329,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFF00000000000007FF0000000000000000
00000000000000000000000000000000",
);
//6080 bytes
-enum graphicalTrieEntries = TrieEntry!(bool, 8, 5, 8)(cast(immutable size_t[]) x"
+enum graphicalTrieEntries = TrieEntry!(bool, 8, 5, 8)(x"
0000000000000000000000000000002000000000000000D0",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000002C00000000000008A00",
-cast(immutable size_t[]) x"
+x"
05040302020201000D0C0B0A09080706100F0E0202020202131313131313121113131313131313131313131313131313
131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313
131313131313131313131313131313131313131313131314131313131313131313131313131313130000000000000000
@@ -6463,11 +6463,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFF07FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
0000000000000000000000000000000000000000000000000000000000000000",
);
//4824 bytes
-enum nonCharacterTrieEntries = TrieEntry!(bool, 7, 4, 4, 6)(cast(immutable size_t[]) x"
+enum nonCharacterTrieEntries = TrieEntry!(bool, 7, 4, 4, 6)(x"
00000000000000000000000000000010000000000000004C000000000000014C",
-cast(immutable size_t[]) x"
+x"
000000000000008000000000000000F0000000000000040000000000000043C0",
-cast(immutable size_t[]) x"
+x"
07060504030201000B0B0B0A090801010B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B
0B0B0B0B0B0B0B0B0D0101010B0B0B0C000000000D010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000030002000100000007000600050004
@@ -6574,11 +6574,11 @@ enum MAX_SIMPLE_LOWER = 1433;
enum MAX_SIMPLE_UPPER = 1450;
enum MAX_SIMPLE_TITLE = 1454;
//10496 bytes
-enum toUpperIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toUpperIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000000000000000000000200000000000000140",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000004800000000000000F80",
-cast(immutable size_t[]) x"
+x"
040203020202010007020202060202050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -6800,11 +6800,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//10112 bytes
-enum toLowerIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toLowerIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000000000000000000000200000000000000140",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000004800000000000000EC0",
-cast(immutable size_t[]) x"
+x"
040203020202010007020202060202050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -7018,11 +7018,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//10496 bytes
-enum toTitleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toTitleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000000000000000000000200000000000000140",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000004800000000000000F80",
-cast(immutable size_t[]) x"
+x"
040203020202010007020202060202050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -7244,11 +7244,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//10368 bytes
-enum toUpperSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toUpperSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000000000000000000000200000000000000140",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000004800000000000000F40",
-cast(immutable size_t[]) x"
+x"
040203020202010007020202060202050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -7467,11 +7467,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//9856 bytes
-enum toLowerSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toLowerSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000000000000000000000200000000000000140",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000004800000000000000E40",
-cast(immutable size_t[]) x"
+x"
040203020202010007020202060202050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -7680,11 +7680,11 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
//10368 bytes
-enum toTitleSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(cast(immutable size_t[]) x"
+enum toTitleSimpleIndexTrieEntries = TrieEntry!(ushort, 8, 7, 6)(x"
000000000000000000000000000000200000000000000140",
-cast(immutable size_t[]) x"
+x"
000000000000010000000000000004800000000000000F40",
-cast(immutable size_t[]) x"
+x"
040203020202010007020202060202050202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202
@@ -7904,7 +7904,7 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
);
immutable(uint)[] toUpperTable() nothrow @nogc pure @safe {
static immutable uint[] t =
-cast(immutable uint[]) x"
+x"
0000004100000042000000430000004400000045000000460000004700000048000000490000004A0000004B0000004C
0000004D0000004E0000004F000000500000005100000052000000530000005400000055000000560000005700000058
000000590000005A0000039C000000C0000000C1000000C2000000C3000000C4000000C5000000C6000000C7000000C8
@@ -8049,7 +8049,7 @@ return t;
}
immutable(uint)[] toLowerTable() nothrow @nogc pure @safe {
static immutable uint[] t =
-cast(immutable uint[]) x"
+x"
0000006100000062000000630000006400000065000000660000006700000068000000690000006A0000006B0000006C
0000006D0000006E0000006F000000700000007100000072000000730000007400000075000000760000007700000078
000000790000007A000000E0000000E1000000E2000000E3000000E4000000E5000000E6000000E7000000E8000000E9
@@ -8183,7 +8183,7 @@ return t;
}
immutable(uint)[] toTitleTable() nothrow @nogc pure @safe {
static immutable uint[] t =
-cast(immutable uint[]) x"
+x"
0000004100000042000000430000004400000045000000460000004700000048000000490000004A0000004B0000004C
0000004D0000004E0000004F000000500000005100000052000000530000005400000055000000560000005700000058
000000590000005A0000039C000000C0000000C1000000C2000000C3000000C4000000C5000000C6000000C7000000C8
diff --git a/libphobos/src/std/logger/core.d b/libphobos/src/std/logger/core.d
index 846f6ee..0633bdd 100644
--- a/libphobos/src/std/logger/core.d
+++ b/libphobos/src/std/logger/core.d
@@ -1473,15 +1473,15 @@ if (sharedLog !is myLogger)
atomicStore!(MemoryOrder.seq)(stdSharedLogger, atomicLoad(logger));
}
-/** This methods get and set the global `LogLevel`.
+/** These methods get and set the global `LogLevel`.
-Every log message with a `LogLevel` lower as the global `LogLevel`
+Every log message with a `LogLevel` lower than the global `LogLevel`
will be discarded before it reaches `writeLogMessage` method of any
`Logger`.
*/
/* Implementation note:
For any public logging call, the global log level shall only be queried once on
-entry. Otherwise when another threads changes the level, we would work with
+entry. Otherwise when another thread changes the level, we would work with
different levels at different spots in the code.
*/
@property LogLevel globalLogLevel() @safe @nogc
diff --git a/libphobos/src/std/math/algebraic.d b/libphobos/src/std/math/algebraic.d
index fd30523..cfb88c8 100644
--- a/libphobos/src/std/math/algebraic.d
+++ b/libphobos/src/std/math/algebraic.d
@@ -974,9 +974,9 @@ private T powIntegralImpl(PowType type, T)(T val)
else
{
static if (isSigned!T)
- return cast(Unqual!T) (val < 0 ? -(T(1) << bsr(0 - val) + type) : T(1) << bsr(val) + type);
+ return cast() cast(T) (val < 0 ? -(T(1) << bsr(0 - val) + type) : T(1) << bsr(val) + type);
else
- return cast(Unqual!T) (T(1) << bsr(val) + type);
+ return cast() cast(T) (T(1) << bsr(val) + type);
}
}
diff --git a/libphobos/src/std/math/hardware.d b/libphobos/src/std/math/hardware.d
index c7c5d6e..dec8fdd 100644
--- a/libphobos/src/std/math/hardware.d
+++ b/libphobos/src/std/math/hardware.d
@@ -315,7 +315,7 @@ private:
{
asm nothrow @nogc
{
- "movgr2fcsr $r2,$r0";
+ "movgr2fcsr $fcsr2,$r0";
}
}
else
@@ -1166,7 +1166,7 @@ private:
{
asm nothrow @nogc
{
- "movgr2fcsr $r0,%0" :
+ "movgr2fcsr $fcsr0,%0" :
: "r" (newState & (roundingMask | allExceptions));
}
}
diff --git a/libphobos/src/std/net/isemail.d b/libphobos/src/std/net/isemail.d
index 12a29fe..2234f35 100644
--- a/libphobos/src/std/net/isemail.d
+++ b/libphobos/src/std/net/isemail.d
@@ -111,8 +111,9 @@ if (isSomeChar!(Char))
auto endOrDie = false;
auto crlfCount = int.min; // int.min == not defined
- foreach (ref i, e ; email)
+ for (size_t i; i < email.length; i++)
{
+ auto e = email[i];
token = email.get(i, e);
switch (context)
diff --git a/libphobos/src/std/path.d b/libphobos/src/std/path.d
index 449235a..a45865a 100644
--- a/libphobos/src/std/path.d
+++ b/libphobos/src/std/path.d
@@ -2732,6 +2732,9 @@ else version (Posix)
The function allocates memory if and only if it gets to the third stage
of this algorithm.
+ Note that `absolutePath` will not normalize `..` segments.
+ Use `buildNormalizedPath(absolutePath(path))` if that is desired.
+
Params:
path = the relative path to transform
base = the base directory of the relative path
@@ -2815,6 +2818,9 @@ string absolutePath(return scope const string path, lazy string base = getcwd())
which allocates memory.)
)
+ Note that `asAbsolutePath` will not normalize `..` segments.
+ Use `asNormalizedPath(asAbsolutePath(path))` if that is desired.
+
Params:
path = the relative path to transform
@@ -3391,7 +3397,7 @@ do
else
{
C[] pattmp;
- foreach (ref pi; 0 .. pattern.length)
+ for (size_t pi = 0; pi < pattern.length; pi++)
{
const pc = pattern[pi];
switch (pc)
diff --git a/libphobos/src/std/process.d b/libphobos/src/std/process.d
index 494910f..325689b 100644
--- a/libphobos/src/std/process.d
+++ b/libphobos/src/std/process.d
@@ -1102,6 +1102,14 @@ private Pid spawnProcessPosix(scope const(char[])[] args,
}
}
+ if (config.preExecDelegate !is null)
+ {
+ if (config.preExecDelegate() != true)
+ {
+ abortOnError(forkPipeOut, InternalError.preExec, .errno);
+ }
+ }
+
// Execute program.
core.sys.posix.unistd.execve(argz[0], argz.ptr, envz);
@@ -1187,7 +1195,7 @@ private Pid spawnProcessPosix(scope const(char[])[] args,
errorMsg = "Failed to allocate memory";
break;
case InternalError.preExec:
- errorMsg = "Failed to execute preExecFunction";
+ errorMsg = "Failed to execute preExecFunction or preExecDelegate";
break;
case InternalError.noerror:
assert(false);
@@ -1271,6 +1279,29 @@ version (Posix)
assert(received);
}
+version (Posix)
+@system unittest
+{
+ __gshared int j;
+ foreach (i; 0 .. 3)
+ {
+ auto config = Config(
+ preExecFunction: function() @trusted {
+ j = 1;
+ return true;
+ },
+ preExecDelegate: delegate() @trusted {
+ // j should now be 1, as preExecFunction is called before
+ // preExecDelegate is.
+ _Exit(i + j);
+ return true;
+ },
+ );
+ auto pid = spawnProcess(["false"], config: config);
+ assert(wait(pid) == i + 1);
+ }
+}
+
/*
Implementation of spawnProcess() for Windows.
@@ -2186,13 +2217,30 @@ struct Config
Please note that the code in this function must only use
async-signal-safe functions.)
+ If $(LREF preExecDelegate) is also set, it is called last.
+
On Windows, this member is not available.
*/
bool function() nothrow @nogc @safe preExecFunction;
+
+ /**
+ A delegate that is called before `exec` in $(LREF spawnProcess).
+ It returns `true` if succeeded and otherwise returns `false`.
+
+ $(RED Warning:
+ Please note that the code in this function must only use
+ async-signal-safe functions.)
+
+ If $(LREF preExecFunction) is also set, it is called first.
+
+ On Windows, this member is not available.
+ */
+ bool delegate() nothrow @nogc @safe preExecDelegate;
}
else version (Posix)
{
bool function() nothrow @nogc @safe preExecFunction;
+ bool delegate() nothrow @nogc @safe preExecDelegate;
}
}
diff --git a/libphobos/src/std/range/package.d b/libphobos/src/std/range/package.d
index 30f6ffb..995bf1e 100644
--- a/libphobos/src/std/range/package.d
+++ b/libphobos/src/std/range/package.d
@@ -313,16 +313,18 @@ if (isBidirectionalRange!(Unqual!Range))
{
@property void front(ElementType!R val)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
- source.back = move(val);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ source.back = __ctfe ? val : forward!val;
}
@property void back(ElementType!R val)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
- source.front = move(val);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ source.front = __ctfe ? val : forward!val;
}
}
@@ -334,9 +336,10 @@ if (isBidirectionalRange!(Unqual!Range))
{
void opIndexAssign(ElementType!R val, size_t n)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
- source[retroIndex(n)] = move(val);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ source[retroIndex(n)] = __ctfe ? val : forward!val;
}
}
@@ -494,6 +497,32 @@ pure @safe nothrow unittest
assert(equal(r, [S(3), S(2), S(1)]));
}
+// https://issues.dlang.org/show_bug.cgi?id=24481
+@safe unittest
+{
+ bool called;
+ struct Handle
+ {
+ int entry;
+ void opAssign()(auto ref const(typeof(this)) that) const { called = true; }
+ }
+
+ const(Handle)[5] arr = [Handle(0), Handle(1), Handle(2), Handle(3), Handle(4)];
+ auto range = arr[].retro();
+
+ called = false;
+ range.front = Handle(42);
+ assert(called);
+
+ called = false;
+ range.back = Handle(42);
+ assert(called);
+
+ called = false;
+ range[2] = Handle(42);
+ assert(called);
+}
+
/**
Iterates range `r` with stride `n`. If the range is a
random-access range, moves by indexing into the range; otherwise,
@@ -604,9 +633,10 @@ do
{
@property void front(ElementType!R val)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
- source.front = move(val);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ source.front = __ctfe ? val : forward!val;
}
}
@@ -899,6 +929,24 @@ pure @safe nothrow unittest
assert(equal(r, [S(1), S(4)]));
}
+// https://issues.dlang.org/show_bug.cgi?id=24481
+@safe unittest
+{
+ bool called;
+ struct Handle
+ {
+ int entry;
+ void opAssign()(auto ref const(typeof(this)) that) const { called = true; }
+ }
+
+ const(Handle)[5] arr = [Handle(0), Handle(1), Handle(2), Handle(3), Handle(4)];
+ auto range = arr[].stride(2);
+
+ called = false;
+ range.front = Handle(42);
+ assert(called);
+}
+
/**
Spans multiple ranges in sequence. The function `chain` takes any
number of ranges and returns a $(D Chain!(R1, R2,...)) object. The
@@ -1120,14 +1168,15 @@ if (Ranges.length > 0 &&
@property void front(RvalueElementType v)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
sw: switch (frontIndex)
{
static foreach (i; 0 .. R.length)
{
case i:
- source[i].front = move(v);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ source[i].front = __ctfe ? v : forward!v;
break sw;
}
@@ -1246,14 +1295,15 @@ if (Ranges.length > 0 &&
{
@property void back(RvalueElementType v)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
sw: switch (backIndex)
{
static foreach_reverse (i; 1 .. R.length + 1)
{
case i:
- source[i-1].back = move(v);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ source[i - 1].back = __ctfe ? v : forward!v;
break sw;
}
@@ -1359,7 +1409,7 @@ if (Ranges.length > 0 &&
static if (allSameType && allSatisfy!(hasAssignableElements, R))
void opIndexAssign(ElementType v, size_t index)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
sw: switch (frontIndex)
{
@@ -1376,7 +1426,8 @@ if (Ranges.length > 0 &&
}
}
- source[i][index] = move(v);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ source[i][index] = __ctfe ? v : forward!v;
break sw;
}
@@ -1683,7 +1734,7 @@ pure @safe unittest
assert(range.array == [S(5), S(6)]);
}
-/// https://issues.dlang.org/show_bug.cgi?id=24064
+// https://issues.dlang.org/show_bug.cgi?id=24064
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
@@ -1716,7 +1767,7 @@ pure @safe nothrow @nogc unittest
}
}
-/// https://issues.dlang.org/show_bug.cgi?id=24243
+// https://issues.dlang.org/show_bug.cgi?id=24243
pure @safe nothrow unittest
{
import std.algorithm.iteration : filter;
@@ -1727,6 +1778,32 @@ pure @safe nothrow unittest
assert(typeof(range).init.empty);
}
+// https://issues.dlang.org/show_bug.cgi?id=24481
+@safe unittest
+{
+ bool called;
+ struct Handle
+ {
+ int entry;
+ void opAssign()(auto ref const(typeof(this)) that) const { called = true; }
+ }
+
+ const(Handle)[5] arr = [Handle(0), Handle(1), Handle(2), Handle(3), Handle(4)];
+ auto range = arr[0 .. 2].chain(arr[4 .. 5]);
+
+ called = false;
+ range.front = Handle(42);
+ assert(called);
+
+ called = false;
+ range.back = Handle(42);
+ assert(called);
+
+ called = false;
+ range[2] = Handle(42);
+ assert(called);
+}
+
/**
Choose one of two ranges at runtime depending on a Boolean condition.
@@ -1882,7 +1959,7 @@ private struct ChooseResult(Ranges...)
this(this)
{
actOnChosen!((ref r) {
- static if (hasElaborateCopyConstructor!(typeof(r))) r.__postblit();
+ static if (hasElaborateCopyConstructor!(typeof(r))) r.__xpostblit();
})(this);
}
@@ -2177,6 +2254,29 @@ pure @safe nothrow unittest
assert(chosen2.front.v == 4);
}
+// https://issues.dlang.org/show_bug.cgi?id=15708
+@safe unittest
+{
+ static struct HasPostblit
+ {
+ this(this) {}
+ }
+
+ static struct Range
+ {
+ bool empty;
+ int front;
+ void popFront() {}
+ HasPostblit member;
+ }
+
+ Range range;
+ int[] arr;
+
+ auto chosen = choose(true, range, arr);
+ auto copy = chosen;
+}
+
/**
Choose one of multiple ranges at runtime.
@@ -2694,12 +2794,14 @@ if (isInputRange!(Unqual!Range) &&
/// ditto
@property void front(ElementType!R v)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
assert(!empty,
"Attempting to assign to the front of an empty "
~ Take.stringof);
- source.front = move(v);
+
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ source.front = __ctfe ? v : forward!v;
}
static if (hasMobileElements!R)
@@ -2996,6 +3098,25 @@ pure @safe nothrow @nogc unittest
assert(r.take(2).equal(repeat(1, 2)));
}
+// https://issues.dlang.org/show_bug.cgi?id=24481
+@safe unittest
+{
+ import std.algorithm.iteration : filter;
+
+ bool called;
+ struct Handle
+ {
+ int entry;
+ void opAssign()(auto ref const(typeof(this)) that) const { called = true; }
+ }
+
+ const(Handle)[5] arr = [Handle(0), Handle(1), Handle(2), Handle(3), Handle(4)];
+ auto range = arr[].filter!(a => true)().take(3);
+
+ called = false;
+ range.front = Handle(42);
+ assert(called);
+}
/**
Similar to $(LREF take), but assumes that `range` has at least $(D
@@ -3075,12 +3196,14 @@ if (isInputRange!R)
{
@property auto ref front(ElementType!R v)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
assert(!empty,
"Attempting to assign to the front of an empty "
~ typeof(this).stringof);
- return _input.front = move(v);
+
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ return _input.front = __ctfe ? v : forward!v;
}
}
}
@@ -3217,6 +3340,26 @@ pure @safe nothrow unittest
}}
}
+// https://issues.dlang.org/show_bug.cgi?id=24481
+@safe unittest
+{
+ import std.algorithm.iteration : filter;
+
+ bool called;
+ struct Handle
+ {
+ int entry;
+ void opAssign()(auto ref const(typeof(this)) that) const { called = true; }
+ }
+
+ const(Handle)[5] arr = [Handle(0), Handle(1), Handle(2), Handle(3), Handle(4)];
+ auto range = arr[].filter!(a => true)().takeExactly(3);
+
+ called = false;
+ range.front = Handle(42);
+ assert(called);
+}
+
/**
Returns a range with at most one element; for example, $(D
takeOne([42, 43, 44])) returns a range consisting of the integer $(D
@@ -4310,9 +4453,10 @@ if (isForwardRange!R && !isInfinite!R)
/// ditto
@property void front(ElementType!R val)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
- _original[_index] = move(val);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ _original[_index] = __ctfe ? val : forward!val;
}
}
@@ -4422,9 +4566,10 @@ if (isForwardRange!R && !isInfinite!R)
/// ditto
@property auto front(ElementType!R val)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
- return _current.front = move(val);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ return _current.front = __ctfe ? val : forward!val;
}
}
@@ -4767,6 +4912,35 @@ pure @safe unittest
assert(equal(r.save, "foof"));
}
+// https://issues.dlang.org/show_bug.cgi?id=24481
+@safe unittest
+{
+ import std.algorithm.iteration : filter;
+
+ bool called;
+ struct Handle
+ {
+ int entry;
+ void opAssign()(auto ref const(typeof(this)) that) const { called = true; }
+ }
+
+ const(Handle)[3] arr = [Handle(0), Handle(1), Handle(2)];
+ {
+ auto range = arr[].cycle().take(5);
+
+ called = false;
+ range.front = Handle(42);
+ assert(called);
+ }
+ {
+ auto range = arr[].filter!(a => true)().cycle().take(5);
+
+ called = false;
+ range.front = Handle(42);
+ assert(called);
+ }
+}
+
private alias lengthType(R) = typeof(R.init.length.init);
/**
@@ -7438,9 +7612,10 @@ struct FrontTransversal(Ror,
{
@property void front(ElementType val)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
- _input.front.front = move(val);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ _input.front.front = __ctfe ? val : forward!val;
}
}
@@ -7497,9 +7672,10 @@ struct FrontTransversal(Ror,
{
@property void back(ElementType val)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
- _input.back.front = move(val);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ _input.back.front = __ctfe ? val : forward!val;
}
}
}
@@ -7532,9 +7708,10 @@ struct FrontTransversal(Ror,
{
void opIndexAssign(ElementType val, size_t n)
{
- import std.algorithm.mutation : move;
+ import core.lifetime : forward;
- _input[n].front = move(val);
+ // __ctfe check is workaround for https://issues.dlang.org/show_bug.cgi?id=21542
+ _input[n].front = __ctfe ? val : forward!val;
}
}
mixin ImplementLength!_input;
@@ -7675,6 +7852,50 @@ pure @safe unittest
assert(ft.empty);
}
+// https://issues.dlang.org/show_bug.cgi?id=24481
+@safe unittest
+{
+ bool called;
+ struct Handle
+ {
+ int entry;
+ void opAssign()(auto ref const(typeof(this)) that) const { called = true; }
+ }
+
+ const(Handle)[][] arr = [[Handle(0), Handle(10)],
+ [Handle(1), Handle(11)],
+ [Handle(2), Handle(12)],
+ [Handle(3), Handle(13)],
+ [Handle(4), Handle(14)]];
+
+ {
+ auto range = arr.frontTransversal();
+
+ called = false;
+ range.front = Handle(42);
+ assert(called == true);
+
+ called = false;
+ range.back = Handle(42);
+ assert(called == true);
+ }
+ {
+ auto range = arr.frontTransversal!(TransverseOptions.assumeNotJagged)();
+
+ called = false;
+ range.front = Handle(42);
+ assert(called == true);
+
+ called = false;
+ range.back = Handle(42);
+ assert(called == true);
+
+ called = false;
+ range[0] = Handle(42);
+ assert(called == true);
+ }
+}
+
/**
Given a range of ranges, iterate transversally through the
`n`th element of each of the enclosed ranges. This function
@@ -10375,6 +10596,14 @@ private struct OnlyResult(T)
}
alias opDollar = length;
+ // FIXME Workaround for https://issues.dlang.org/show_bug.cgi?id=24415
+ import std.traits : hasElaborateCopyConstructor;
+ static if (hasElaborateCopyConstructor!T)
+ {
+ private static struct WorkaroundBugzilla24415 {}
+ public this()(WorkaroundBugzilla24415) {}
+ }
+
private this()(return scope auto ref T value)
{
ref @trusted unqual(ref T x){return cast() x;}
diff --git a/libphobos/src/std/socket.d b/libphobos/src/std/socket.d
index 4052479..e86a51f 100644
--- a/libphobos/src/std/socket.d
+++ b/libphobos/src/std/socket.d
@@ -1116,7 +1116,7 @@ Address[] getAddress(scope const(char)[] hostname, ushort port)
// test via gethostbyname
auto getaddrinfoPointerBackup = getaddrinfoPointer;
cast() getaddrinfoPointer = null;
- scope(exit) cast() getaddrinfoPointer = getaddrinfoPointerBackup;
+ scope(exit) () @trusted { cast() getaddrinfoPointer = getaddrinfoPointerBackup; }();
addresses = getAddress("63.105.9.61");
assert(addresses.length && addresses[0].toAddrString() == "63.105.9.61");
@@ -1196,7 +1196,7 @@ Address parseAddress(scope const(char)[] hostaddr, ushort port)
// test via inet_addr
auto getaddrinfoPointerBackup = getaddrinfoPointer;
cast() getaddrinfoPointer = null;
- scope(exit) cast() getaddrinfoPointer = getaddrinfoPointerBackup;
+ scope(exit) () @trusted { cast() getaddrinfoPointer = getaddrinfoPointerBackup; }();
address = parseAddress("63.105.9.61");
assert(address.toAddrString() == "63.105.9.61");
@@ -1698,7 +1698,7 @@ public:
// test reverse lookup, via gethostbyaddr
auto getnameinfoPointerBackup = getnameinfoPointer;
cast() getnameinfoPointer = null;
- scope(exit) cast() getnameinfoPointer = getnameinfoPointerBackup;
+ scope(exit) () @trusted { cast() getnameinfoPointer = getnameinfoPointerBackup; }();
assert(ia.toHostNameString() == "digitalmars.com");
}
@@ -1716,7 +1716,7 @@ public:
// test failing reverse lookup, via gethostbyaddr
auto getnameinfoPointerBackup = getnameinfoPointer;
cast() getnameinfoPointer = null;
- scope(exit) cast() getnameinfoPointer = getnameinfoPointerBackup;
+ scope(exit) () @trusted { cast() getnameinfoPointer = getnameinfoPointerBackup; }();
assert(ia.toHostNameString() is null);
}
@@ -1925,7 +1925,7 @@ version (StdDdoc)
* auto abstractAddr = new UnixAddress("\0/tmp/dbus-OtHLWmCLPR");
* ---
*
- * See_Also: $(HTTP http://man7.org/linux/man-pages/man7/unix.7.html, UNIX(7))
+ * See_Also: $(HTTP man7.org/linux/man-pages/man7/unix.7.html, UNIX(7))
*/
class UnixAddress: Address
{
diff --git a/libphobos/src/std/sumtype.d b/libphobos/src/std/sumtype.d
index 4e76156..80ce73d 100644
--- a/libphobos/src/std/sumtype.d
+++ b/libphobos/src/std/sumtype.d
@@ -1988,7 +1988,7 @@ private template matchImpl(Flag!"exhaustive" exhaustive, handlers...)
? "template"
: typeof(handler).stringof
) ~ "` " ~
- "never matches"
+ "never matches. Perhaps the handler failed to compile"
);
}
diff --git a/libphobos/src/std/traits.d b/libphobos/src/std/traits.d
index 2e7a4f6..5ed37a1 100644
--- a/libphobos/src/std/traits.d
+++ b/libphobos/src/std/traits.d
@@ -2181,7 +2181,7 @@ if (isCallable!func)
/**
-Get the function type from a callable object `func`.
+Get the function type from a callable object `func`, or from a function pointer/delegate type.
Using builtin `typeof` on a property function yields the types of the
property value, not of the property function itself. Still,
@@ -2229,10 +2229,17 @@ if (isCallable!func)
{
class C
{
- int value() @property { return 0; }
+ int value() @property => 0;
+ static string opCall() => "hi";
}
static assert(is( typeof(C.value) == int ));
static assert(is( FunctionTypeOf!(C.value) == function ));
+ static assert(is( FunctionTypeOf!C == typeof(C.opCall) ));
+
+ int function() fp;
+ alias IntFn = int();
+ static assert(is( typeof(fp) == IntFn* ));
+ static assert(is( FunctionTypeOf!fp == IntFn ));
}
@system unittest
diff --git a/libphobos/src/std/typecons.d b/libphobos/src/std/typecons.d
index 460cd42..f5b4846 100644
--- a/libphobos/src/std/typecons.d
+++ b/libphobos/src/std/typecons.d
@@ -980,7 +980,7 @@ if (distinctFieldNames!(Specs))
{
import std.algorithm.mutation : swap;
- static if (is(R : Tuple!Types) && !__traits(isRef, rhs) && isTuple!R)
+ static if (is(R == Tuple!Types) && !__traits(isRef, rhs) && isTuple!R)
{
if (__ctfe)
{
diff --git a/libphobos/src/std/utf.d b/libphobos/src/std/utf.d
index 3eef5cb..c0cd386 100644
--- a/libphobos/src/std/utf.d
+++ b/libphobos/src/std/utf.d
@@ -328,7 +328,7 @@ Returns:
bool isValidCodepoint(Char)(Char c)
if (isSomeChar!Char)
{
- alias UChar = Unqual!Char;
+ alias UChar = typeof(cast() c);
static if (is(UChar == char))
{
return c <= 0x7F;
@@ -1418,8 +1418,8 @@ do
}
else
{
- alias Char = Unqual!(ElementType!S);
- Char[4] codeUnits;
+ alias Char = typeof(cast() ElementType!S.init);
+ Char[4] codeUnits = void;
S tmp = str.save;
for (size_t i = numCodeUnits; i > 0; )
{
@@ -2821,7 +2821,7 @@ if (isSomeChar!C)
size_t codeLength(C, InputRange)(InputRange input)
if (isSomeFiniteCharInputRange!InputRange)
{
- alias EncType = Unqual!(ElementEncodingType!InputRange);
+ alias EncType = typeof(cast() ElementEncodingType!InputRange.init);
static if (isSomeString!InputRange && is(EncType == C) && is(typeof(input.length)))
return input.length;
else
@@ -3089,7 +3089,8 @@ private T toUTFImpl(T, S)(scope S s)
static if (is(S == C[], C) || hasLength!S)
app.reserve(s.length);
- foreach (c; s.byUTF!(Unqual!(ElementEncodingType!T)))
+ ElementEncodingType!T e = void;
+ foreach (c; s.byUTF!(typeof(cast() ElementEncodingType!T.init)))
app.put(c);
return app.data;
@@ -3168,10 +3169,10 @@ if (is(immutable typeof(*P.init) == typeof(str[0])))
return trustedPtr();
}
- alias C = Unqual!(ElementEncodingType!S);
+ alias C = typeof(cast() ElementEncodingType!S.init);
//If the P is mutable, then we have to make a copy.
- static if (is(Unqual!(typeof(*P.init)) == typeof(*P.init)))
+ static if (is(typeof(cast() *P.init) == typeof(*P.init)))
{
return toUTFzImpl!(P, const(C)[])(cast(const(C)[])str);
}
@@ -3203,13 +3204,15 @@ private P toUTFzImpl(P, S)(return scope S str) @safe pure
if (is(typeof(str[0]) C) && is(immutable typeof(*P.init) == immutable C) && !is(C == immutable))
//C[] or const(C)[] -> C*, const(C)*, or immutable(C)*
{
- alias InChar = typeof(str[0]);
- alias OutChar = typeof(*P.init);
+ alias InChar = typeof(str[0]);
+ alias UInChar = typeof(cast() str[0]); // unqualified version of InChar
+ alias OutChar = typeof(*P.init);
+ alias UOutChar = typeof(cast() *P.init); // unqualified version
//const(C)[] -> const(C)* or
//C[] -> C* or const(C)*
- static if (( is(const(Unqual!InChar) == InChar) && is(const(Unqual!OutChar) == OutChar)) ||
- (!is(const(Unqual!InChar) == InChar) && !is(immutable(Unqual!OutChar) == OutChar)))
+ static if (( is(const(UInChar) == InChar) && is( const(UOutChar) == OutChar)) ||
+ (!is(const(UInChar) == InChar) && !is(immutable(UOutChar) == OutChar)))
{
if (!__ctfe)
{
@@ -3228,7 +3231,7 @@ if (is(typeof(str[0]) C) && is(immutable typeof(*P.init) == immutable C) && !is(
else
{
import std.array : uninitializedArray;
- auto copy = uninitializedArray!(Unqual!OutChar[])(str.length + 1);
+ auto copy = uninitializedArray!(UOutChar[])(str.length + 1);
copy[0 .. $ - 1] = str[];
copy[$ - 1] = '\0';
diff --git a/libphobos/src/std/uuid.d b/libphobos/src/std/uuid.d
index dec2a1c..b8cac6e 100644
--- a/libphobos/src/std/uuid.d
+++ b/libphobos/src/std/uuid.d
@@ -1207,7 +1207,7 @@ public struct UUID
* randomGen = uniform RNG
* See_Also: $(REF isUniformRNG, std,random)
*/
-@safe UUID randomUUID()
+@nogc nothrow @safe UUID randomUUID()
{
import std.random : rndGen;
// A PRNG with fewer than `n` bytes of state cannot produce
diff --git a/libphobos/src/std/variant.d b/libphobos/src/std/variant.d
index 41cd484..f7832104 100644
--- a/libphobos/src/std/variant.d
+++ b/libphobos/src/std/variant.d
@@ -382,7 +382,7 @@ private:
static if (isStaticArray!A && isDynamicArray!T)
{
auto this_ = (*src)[];
- emplaceRef(*cast(Unqual!T*) zat, cast(Unqual!T) this_);
+ emplaceRef(*cast(Unqual!T*) zat, cast() cast(T) this_);
}
else
{