Jacob Carlborg:
I believe that for aliasing function pointers only the latter
syntax works.
It's a bug that needs to be fixed before the deprecation of old
style alias syntax...
Bye,
bearophile
On Tue, 22 Apr 2014 18:54:41 -0400, Meta wrote:
On Tuesday, 22 April 2014 at 21:35:31 UTC, Meta wrote:
Does this work if test is in a different module from main?
struct test
{
private int opBinary(string op: "*")(test other) { return 3; }
public alias opMul = opBinary!"*";
}
On 22/04/14 20:06, Brian Schott wrote:
We have "alias a = b;" and "alias b a;", so there's precedent for having
two ways of doing exactly the same thing.
I believe that for aliasing function pointers only the latter syntax works.
--
/Jacob Carlborg
On Tuesday, 22 April 2014 at 21:35:31 UTC, Meta wrote:
Does this work if test is in a different module from main?
struct test
{
private int opBinary(string op: "*")(test other) { return 3; }
public alias opMul = opBinary!"*";
}
void main()
{
test t1 = test();
tes
On Tuesday, 22 April 2014 at 15:50:21 UTC, Daniel Murphy wrote:
"Andrej Mitrovic" wrote in message
news:ifghzjafvfqrqkhlp...@forum.dlang.org...
Old-style operator overloads (such as opCom, opAnd, etc) have
largely been superseded by new-style templated operator
overloads (opUnary, opBinary,
Brian Schott:
We have "alias a = b;" and "alias b a;", so there's precedent
for having two ways of doing exactly the same thing.
I've just filed a bug report:
https://issues.dlang.org/show_bug.cgi?id=12615
Bye,
bearophile
On 04/22/2014 02:06 PM, Brian Schott wrote:
> On Tuesday, 22 April 2014 at 17:43:58 UTC, Daniel Murphy wrote:
>> Of course we can.
>
> We have "alias a = b;" and "alias b a;", so there's precedent for having two
> ways of doing exactly the same thing.
Except that's another case of "we had one way
On Tue, 22 Apr 2014 14:15:21 -0400, Daniel Murphy
wrote:
"Steven Schveighoffer" wrote in message
news:op.xeqcf3vbeav7ka@stevens-macbook-pro-2.local...
If the old behavior can be exactly mimiced, I think we can get rid of
the old behavior.
Can != Should
Sorry I misspoke. We *should*
"Steven Schveighoffer" wrote in message
news:op.xeqcf3vbeav7ka@stevens-macbook-pro-2.local...
If the old behavior can be exactly mimiced, I think we can get rid of the
old behavior.
Can != Should
Less code in the compiler, less complexity in the language.
More complexity in user code.
On Tue, 22 Apr 2014 13:43:58 -0400, Daniel Murphy
wrote:
"bearophile" wrote in message
news:pvkqreqswxwusojgp...@forum.dlang.org...
you can't keep two different operator overloading systems in a language.
Of course we can.
If the old behavior can be exactly mimiced, I think we can get
On Tuesday, 22 April 2014 at 17:43:58 UTC, Daniel Murphy wrote:
Of course we can.
We have "alias a = b;" and "alias b a;", so there's precedent for
having two ways of doing exactly the same thing.
"bearophile" wrote in message news:pvkqreqswxwusojgp...@forum.dlang.org...
you can't keep two different operator overloading systems in a language.
Of course we can.
Daniel Murphy:
I prefer the old ones mainly because
You can't remove the new ones, and you can't keep two different
operator overloading systems in a language.
Bye,
bearophile
"Andrej Mitrovic" wrote in message
news:ifghzjafvfqrqkhlp...@forum.dlang.org...
Old-style operator overloads (such as opCom, opAnd, etc) have largely been
superseded by new-style templated operator overloads (opUnary, opBinary,
etc).
I prefer the old ones mainly because the names are better
On Tue, 22 Apr 2014 10:21:40 -0400, Andrej Mitrovic
wrote:
Old-style operator overloads (such as opCom, opAnd, etc) have largely
been superseded by new-style templated operator overloads (opUnary,
opBinary, etc).
But the old-style operators are not listed on the deprecation page, they
On Tuesday, 22 April 2014 at 14:21:42 UTC, Andrej Mitrovic wrote:
this brought up some issues w.r.t. the compilation performance
when using templates and potential object bloat as well.
If templates are an issue, you can always just write a
non-template function, and template the alias:
```D
Old-style operator overloads (such as opCom, opAnd, etc) have
largely been superseded by new-style templated operator overloads
(opUnary, opBinary, etc).
But the old-style operators are not listed on the deprecation
page, they don't seem to be planned to be deprecated/removed. I
recall a few
17 matches
Mail list logo