On 08/22/2014 02:38 PM, Ali Çehreli wrote:
Does that mean that one is the
instance of the other? Will have to test that separately.)
I opened the following bug about isInstanceOf!(Foo!int, Foo!int)
producing 'true':
https://issues.dlang.org/show_bug.cgi?id=13364
Ali
) {
// Error: specialization not allowed for deduced parameter N
auto opBinary(string op, UT : UnitDef!N, string N)(UT rhs) if
(op == *) {
return UnitDef!(unitString ~ ~ N)();
}
}
enum ft = UnitDef!ft();
enum s = UnitDef!s();
pragma(msg, typeof(ft*s));
I've tried
On Friday, 22 August 2014 at 20:42:49 UTC, Yota wrote:
Heya. I'm working on a simple units-of-measure implementation
in DMD 2.066.0, and it doesn't seem to like the signature of my
'*' operator below. I'm afraid I don't understand what the
error description is trying to tell me. Here's a
On 08/22/2014 01:45 PM, Yota wrote:
On Friday, 22 August 2014 at 20:42:49 UTC, Yota wrote:
Heya. I'm working on a simple units-of-measure implementation in DMD
2.066.0, and it doesn't seem to like the signature of my '*' operator
below. I'm afraid I don't understand what the error description
On Friday, 22 August 2014 at 21:22:39 UTC, Ali Çehreli wrote:
On 08/22/2014 01:45 PM, Yota wrote:
On Friday, 22 August 2014 at 20:42:49 UTC, Yota wrote:
Heya. I'm working on a simple units-of-measure
implementation in DMD
2.066.0, and it doesn't seem to like the signature of my '*'
operator
On 08/22/2014 02:22 PM, Ali Çehreli wrote:
Admittedly, std.traits.isInstanceOf is the right tool to use
Answering myself: Yes, it is.
but both of
the following worked!
I figured that out.
auto opBinary(string op, That)(That rhs)
if (isInstanceOf!(UnitDef, That)
Note that
On Friday, 22 August 2014 at 21:38:29 UTC, Ali Çehreli wrote:
So, the correct check should use std.traits.TemplateOf first:
auto opBinary(string op, That)(That rhs)
if (isInstanceOf!(TemplateOf!UnitDef, That)
op == *) {
return UnitDef!(unitString ~ ~
On 08/22/2014 07:47 PM, Yota wrote:
So what's up with the syntax I tried before? Has it been
deprecated?
I don't know the details. I am curious as well.
I think it is related to value template parameters. The first example
below fails but the second one works. The only difference is that