Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template TokenIdType(alias staticTokens, alias dynamicTokens,
- alias possibleDefaultTokens)
- {
- immutable tokenCount = staticTokens.length + dynamicTokens.length
- + possibleDefaultTokens.length + 1;
- static if (tokenCount <= ubyte.max)
- alias TokenIdType = ubyte;
- else static if (tokenCount <= ushort.max)
- alias TokenIdType = ushort;
- else static if (tokenCount <= uint.max)
- alias TokenIdType = uint;
- else
- static assert (false, "The number of tokens must be less than uint.max");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement