← Back to index
|
Original Bugzilla link
Bug 2669 – Variant does not have opApply or another iteration mechanism
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-02-15T12:26:00Z
Last change time
2014-02-14T20:35:47Z
Assigned to
andrei
Creator
andrei
Comments
Comment #0
by andrei — 2009-02-15T12:26:03Z
Credit due to Chris Nicholson-Sauls.
Comment #1
by bugzilla — 2009-03-14T20:57:15Z
I think this means std.variant in Phobos.
Comment #2
by dhasenan — 2009-03-14T21:16:47Z
It might be worthwhile to examine the following:
http://dsource.org/projects/dmocks/browser/dunit/trunk/dunit/assertions/variant.d
http://dsource.org/projects/dmocks/browser/dunit/trunk/dunit/assertions/variant_array.d
The former defines yet another Variant; the latter defines a VariantArray that allows iteration as if it were an array of Variants. This only applies to dynamic and static arrays; it doesn't apply to associative arrays. They also reference my runtime traits module, linked for completeness:
http://dsource.org/projects/dmocks/browser/reflect/reflect/RuntimeTraits.d
Comment #3
by andrei — 2009-08-27T14:27:32Z
I implemented a rather limited opApply for now, but I'll keep this open while I think of a better solution.
Comment #4
by andrei — 2010-09-26T13:34:33Z
Fixed:
http://www.dsource.org/projects/phobos/changeset/2059