[Issue 2074] Variant arithmetic operations fail

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 6 16:33:12 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2074





------- Comment #5 from arkangath at gmail.com  2008-05-06 18:33 -------
(In reply to comment #4)
> I looked into it some more and I think the best engineering solution is to
> remove support for right-hand-side operations in Variant.
> 
> This would require the occasional explicitness, e.g. Variant(5) - x instead of
> 5 - x, but I see that as a small disadvantage that avoids a hecatomb of
> bloating in the source.
> 
> Please advise.
> 

Truly, it would be best to sacrifice the right-hand-side operations. The
rationale for this decision however should be stated on the documentation.
Perhaps someday a compromise of D's operator overloading (or template
instantiation) may be reached which makes these operations possible.

Before closing the variant file however, have a look at #2073.


-- 



More information about the Digitalmars-d-bugs mailing list