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.

Function std.uni.toTrie

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

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

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 section for example.


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


Dmitry Olshansky


Boost License 1.0.