http://d.puremagic.com/issues/show_bug.cgi?id=7356
Summary: Implement KeyType, ValueType for hashes in std.traits Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: andrej.mitrov...@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2012-01-23 22:50:34 PST --- I've had a use-case for these but they were not in std.traits, so here's an implementation: import std.traits; template KeyType(AA) if (isAssociativeArray!AA) { static if (is(AA V : V[K], K)) { alias K KeyType; } } template ValueType(AA) if (isAssociativeArray!AA) { static if (is(AA V : V[U], U)) { alias V ValueType; } } If I get an OK I can make a pull for this (with documentation). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------