On Sat, May 26, 2012 at 09:53:07PM +0200, Andrej Mitrovic wrote:
> I don't understand this:
>
> import std.stdio;
>
> struct Symbol { string val; }
>
> void main()
> {
> int[string] hash1;
> hash1["1".idup] = 1;
> hash1["1".idup] = 2;
> writeln(hash1); // writes "["1":2]"
>
>
Fail.
Ok, i tried something like this:
[code]
import std.stdio;
mixin template TConvertTo(T : Object, U) {
T!(U) ConvertTo() inout {
return cast(T!U) this;
}
alias ConvertTo this;
}
class Foo(T) {
public:
T Num;
mixin TCo
On 06/03/2012 08:43 PM, Namespace wrote:
I think this should work:
[code]
import std.stdio;
class Foo(T) {
public:
T Num;
@property
Foo!(U) ConvertTo(U)() inout {
return cast(Foo!(U)) this;
}
alias ConvertTo this;
}
void Call(const Foo!(float) FFoo) {
}
vo
I think this should work:
[code]
import std.stdio;
class Foo(T) {
public:
T Num;
@property
Foo!(U) ConvertTo(U)() inout {
return cast(Foo!(U)) this;
}
alias ConvertTo this;
}
void Call(const Foo!(float) FFoo) {
}
void m