View source code Display the source code in std/uni.d from which this page was generated on github. 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. Page wiki View or edit the community-maintained wiki page associated with this page.

Function std.uni.toTrie

Convenience function to construct optimal configurations for packed Trie from any set of .

The parameter level indicates the number of trie levels to use, allowed values are: 1, 2, 3 or 4. Levels represent different trade-offs speed-size wise.

Level 1 is fastest and the most memory hungry (a bit array).

Level 4 is the slowest and has the smallest footprint.

See the Synopsis, Synopsis section for example.

Prototype

auto toTrie(ulong level, Set)(
  Set set
)
if (isCodepointSet!Set);

Note

Level 4 stays very practical (being faster and more predictable) compared to using direct lookup on the set itself.

Authors

Dmitry Olshansky

License

Boost License 1.0.

Comments