Bug 10569 – std.traits: EnumMembers, isExpressionTuple, isTypeTuple & Largest balks at large input
Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-08T04:46:00Z
Last change time
2013-12-11T01:53:28Z
Assigned to
nobody
Creator
simen.kjaras
Comments
Comment #0 by simen.kjaras — 2013-07-08T04:46:19Z
The templates EnumMembers, isExpressionTuple, isTypeTuple and Largest in std.traits fail due to recursive template expansion when instantiated with large inputs (>500):
import std.traits : EnumMembers;
mixin({
import std.conv : to;
string s = "enum m {";
foreach (i; 0..500) {
s ~= "m" ~ to!string(i) ~ ",";
}
return s ~ "}";
}());
EnumMembers!m; // Error: template instance std.traits.EnumMembers!(m).WithIdentifier!("m498") recursive expansion