opCast overloading and opCast_r

nazo lovesyao at gmail.com
Fri Dec 1 17:48:03 PST 2006


Oskar Linde wrote:
> Interesting ideas. I can't see off hand what uses mixing types and 
> expressions in binary operations could have. Do you have any such in 
> mind? Also, doesn't this introduce ambiguities?
> 
> Type *val; // Type.opfunc(val) or declaration of ptr to Type?
I have no mind but this extend more representation.
I think that this doesn't introduce ambiguities because this section is 
after semantic analysis.
> Allowing
> 
> T opCast(T)() {...}
> 
> is great. The next step should be making opCast conversions implicit 
> instead of explicit and thereby usable. :)
> This also calls for better template specialization methods...
really. I had forgotten:-(
> opCast_r is a really interesting idea close to C++ implicit 
> constructors. They should also be implicit to be of much use.
> 
> /Oskar
> 



More information about the Digitalmars-d mailing list