View source code
Display the source code in std/uni.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
std.uni.InversionList.this
- multiple declarations
Function InversionList.this
Construct from another code point set of any type.
this(Set)
(
Set set
) pure
if (isCodepointSet!Set);
Function InversionList.this
Construct a set from a forward range of code point intervals.
this(Range)
(
Range intervals
) pure
if (isForwardRange!Range && isIntegralPair!(ElementType!Range));
Function InversionList.this
Construct a set from plain values of code point intervals.
this();
Example
import std .algorithm .comparison : equal;
auto set = CodepointSet('a', 'z'+1, 'а', 'я'+1);
foreach (v; 'a'..'z'+1)
assert(set[v]);
// Cyrillic lowercase interval
foreach (v; 'а'..'я'+1)
assert(set[v]);
//specific order is not required, intervals may interesect
auto set2 = CodepointSet('а', 'я'+1, 'a', 'd', 'b', 'z'+1);
//the same end result
assert(set2 .byInterval .equal(set .byInterval));
// test constructor this(Range)(Range intervals)
auto chessPiecesWhite = CodepointInterval(9812, 9818);
auto chessPiecesBlack = CodepointInterval(9818, 9824);
auto set3 = CodepointSet([chessPiecesWhite, chessPiecesBlack]);
foreach (v; '♔'..'♟'+1)
assert(set3[v]);
Authors
Dmitry Olshansky
License
Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.