Variant/Variant/Box wrappers?
Christopher Wright
dhasenan at gmail.com
Sun Jan 6 06:09:21 PST 2008
Dan wrote:
> Christopher Wright Wrote:
>
>> Hey --
>>
>> I've got stuff that I want to work in dmd1/phobos, dmd2/phobos, and
>> dmd1/tango. I really want to use boxing, since it'd make a lot of stuff
>> easier, but there are three disparate structs to support: tango Variant,
>> phobos Variant, and phobos Box.
>>
>> Does anyone have wrappers for these? If so, do they handle structs of
>> arbitrary sizes? (Phobos Variant doesn't, which makes it mostly useless
>> without a wrapper anyway.)
>
> The way I did things was I rolled my own. In all honesty though, if you like the way one works, just use the actual source for it in your project.
>
> e:/dmd/src/phobos/std/boxer.d
> http://dsource.org/projects/walnut/browser/branches/1.9/source/value.d
>
> Something like that.
>
> Regards,
> Dan
Thanks, though I can't see how yours supports structs.
I think I don't want to maintain any sort of custom box type; I've
solved the problem with early casting of the stuff that's supposed to
return variable-typed values.
More information about the Digitalmars-d-learn
mailing list