-
-
Notifications
You must be signed in to change notification settings - Fork 706
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
std.sumtype: Move TagTuple to module level to reduce instantiations
TagTuple wass previously nested within matchImpl, meaning it gets a different instantiation for each match call with different handlers. This is not required, as the only template parameters it needs are the SumTypes being used. In practice, we might even get away with using the length, but the gain is likely to be marginal compared to the gains from moving it out of matchImpl. Another underlying motivation for this change is that it works around a compiler bug triggered with complex code using const SumType (the compiler complains that 'this' for 'invariant' is of the wrong type, const vs non-const).
- Loading branch information
Showing
1 changed file
with
76 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters