Cast Object - get null

Namespace rswhite4 at googlemail.com
Wed Apr 18 11:02:32 PDT 2012


> 1. opCast doesn't do an implict cast. You'll have to cast to 
> get == to work.
>
> 2. If you really have a static opCall, then the new isn't 
> necessary.
>
> 3. You need to return from opCast. You're just declaring a 
> local variable.
>
> 4. You need to import std.traits, or using Unqual will cause 
> the template
> constraint to fail.
>
> - Jonathan M Davis

1. What have i to cast explicit? I thought that does the 
overloaded opEquals for me?
2. See my post above.
3. I return with "return U(this.x, this.y);" that is not a local 
variable, imo.
4. Of course i import it, but it is implicit import if i import 
std.stdio.

Here my total sourc eto avoid misconceptions: 
http://codepad.org/fnkyysYu


More information about the Digitalmars-d-learn mailing list