I can't think of any solution they might provide sorry.
You know there are C++ equivalents, for years and they didn't solve any problems above. Maybe i can use them to disable implicit casting, but then again program won't compile. :P

Thanks!

On Sun, 28 Mar 2010 18:09:21 +0400, biozic <[email protected]> wrote:

Le 28/03/10 10:57, so a écrit :
Well, i am having hard time explaining, it is not a surprise that you
don't understand.
To make things clearer, lets forget floats for a seconds and change your
code to standard unsigned types.


import std.stdio: writeln;

struct Vector(T) {
this(T m) { mm = m; }
Vector opBinary(string op:"*", T2)(T2 m) if(is(T2 == T)) {
return Vector(mm * m);
}
T mm;
}

Have you checked std.traits, where isIntegral!T, isFloatingPoint!T, etc. are defined? Could these, used as template constraints, solve your problem?



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Reply via email to