On Tuesday, 20 July 2021 at 18:32:26 UTC, Ali Çehreli wrote:
On 7/19/21 11:20 PM, Tejas wrote:
> trying to create the spaceship operator of C++
Just to make sure, D's opCmp returns an int. That new C++
operator was added to provide the same semantics.
Ali
I know. As I already mentioned, I
On 7/20/21 11:49 AM, H. S. Teoh wrote:
> On Tue, Jul 20, 2021 at 11:32:26AM -0700, Ali Çehreli via
Digitalmars-d-learn wrote:
>> On 7/19/21 11:20 PM, Tejas wrote:
>>
>>> trying to create the spaceship operator of C++
>>
>> Just to make sure, D's opCmp returns an int. That new C++ operator was
>
On Tuesday, 20 July 2021 at 18:49:07 UTC, H. S. Teoh wrote:
On Tue, Jul 20, 2021 at 11:32:26AM -0700, Ali Çehreli via
Digitalmars-d-learn wrote:
On 7/19/21 11:20 PM, Tejas wrote:
> trying to create the spaceship operator of C++
Just to make sure, D's opCmp returns an int. That new C++
operato
On Tue, Jul 20, 2021 at 11:32:26AM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 7/19/21 11:20 PM, Tejas wrote:
>
> > trying to create the spaceship operator of C++
>
> Just to make sure, D's opCmp returns an int. That new C++ operator was
> added to provide the same semantics.
[...]
F
On 7/19/21 11:20 PM, Tejas wrote:
> trying to create the spaceship operator of C++
Just to make sure, D's opCmp returns an int. That new C++ operator was
added to provide the same semantics.
Ali
On Tuesday, 20 July 2021 at 06:34:45 UTC, vit wrote:
On Tuesday, 20 July 2021 at 06:20:34 UTC, Tejas wrote:
...
Initially, I was trying to create the spaceship operator of
C++, but we aren't allowed to create new operators
...
D has spaceship operator: opCmp
(https://dlang.org/spec/operator
On Tuesday, 20 July 2021 at 06:30:56 UTC, Mike Parker wrote:
On Tuesday, 20 July 2021 at 06:20:34 UTC, Tejas wrote:
Why isn't it working by default?
Initially, I was trying to create the spaceship operator of
C++, but we aren't allowed to create new operators, it seems.
Then I just wanted to
On Tuesday, 20 July 2021 at 06:20:34 UTC, Tejas wrote:
Why isn't it working by default?
Initially, I was trying to create the spaceship operator of
C++, but we aren't allowed to create new operators, it seems.
Then I just wanted to verify whether we can even overload an
operator globally, but
On Tuesday, 20 July 2021 at 06:20:34 UTC, Tejas wrote:
...
Initially, I was trying to create the spaceship operator of
C++, but we aren't allowed to create new operators
...
D has spaceship operator: opCmp
(https://dlang.org/spec/operatoroverloading.html#compare).
The following doesn't work:
```d
import std;
int opBinary(string s:"+")(int a, int b){
int result;
ab? (result = 1): (result = 0);
return result;
}
void main(){
int f = 1 + 5;
writeln(f);
}
```
It outputs 6
But if I manually write it as
```d
int f = opBinary!"+"(1,5);
```
It w
10 matches
Mail list logo