mirror of
https://github.com/dlang/phobos.git
synced 2025-05-02 08:00:48 +03:00
workaround stable sort (std.move) not CTFE-able
This commit is contained in:
parent
1c86ecf0c4
commit
d0e408d5f4
1 changed files with 11 additions and 1 deletions
12
std/uni.d
12
std/uni.d
|
@ -2007,6 +2007,16 @@ public:
|
||||||
sanitize(); //enforce invariant: sort intervals etc.
|
sanitize(); //enforce invariant: sort intervals etc.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//helper function that avoids sanity check to be CTFE-friendly
|
||||||
|
private static fromIntervals(Range)(Range intervals)
|
||||||
|
{
|
||||||
|
auto flattened = roundRobin(intervals.save.map!"a[0]"(),
|
||||||
|
intervals.save.map!"a[1]"());
|
||||||
|
InversionList set;
|
||||||
|
set.data = Uint24Array!(SP)(flattened);
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Construct a set from plain values of code point intervals.
|
Construct a set from plain values of code point intervals.
|
||||||
Example:
|
Example:
|
||||||
|
@ -8576,7 +8586,7 @@ private:
|
||||||
|
|
||||||
@safe auto asSet(const (ubyte)[] compressed)
|
@safe auto asSet(const (ubyte)[] compressed)
|
||||||
{
|
{
|
||||||
return CodepointSet(decompressIntervals(compressed));
|
return CodepointSet.fromIntervals(decompressIntervals(compressed));
|
||||||
}
|
}
|
||||||
|
|
||||||
@safe pure nothrow auto asTrie(T...)(in TrieEntry!T e)
|
@safe pure nothrow auto asTrie(T...)(in TrieEntry!T e)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue