Thread overview | |||||
---|---|---|---|---|---|
|
January 05, 2008 Variant/Variant/Box wrappers? | ||||
---|---|---|---|---|
| ||||
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.) |
January 06, 2008 Re: Variant/Variant/Box wrappers? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christopher Wright | 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 |
January 06, 2008 Re: Variant/Variant/Box wrappers? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dan | 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.
|
Copyright © 1999-2021 by the D Language Foundation