On Friday, 5 August 2022 at 21:24:13 UTC, Steven Schveighoffer
wrote:
That's not what I was talking about here. I'm talking about
`-vcg-ast` not telling you how it's calling the function.
Thanks for clarification.
I had that in mind but wasn't sure. I first thought it just get
optimized
On 8/5/22 3:53 PM, frame wrote:
On Friday, 5 August 2022 at 15:24:16 UTC, Steven Schveighoffer wrote:
oof, I expected this to include the template parameters! I believe it
normally does?
This is a bug that should be filed.
-Steve
Sorry, I don't get what you takling about?
The docs says:
On Friday, 5 August 2022 at 15:24:16 UTC, Steven Schveighoffer
wrote:
oof, I expected this to include the template parameters! I
believe it normally does?
This is a bug that should be filed.
-Steve
Sorry, I don't get what you takling about?
The docs says:
The expression:
`a op= b`
is
On 8/5/22 11:24 AM, Steven Schveighoffer wrote:
On 8/4/22 10:27 PM, jfondren wrote:
a.opOpAssign(b);
b.opOpAssign(a);
oof, I expected this to include the template parameters! I believe it
normally does?
It does not! I'm genuinely shocked.
```d
void foo(string s, T)(T t) {}
void
On 8/4/22 10:27 PM, jfondren wrote:
The output's not that useful...
```d
import object;
struct S
{
int n;
void opOpAssign(string op)(S rhs) if (op == "/=")
{
n++;
}
void opOpAssign(string op)(S rhs) if (op == "/")
{
}
}
unittest
{
S a = S(1);
On Friday, 5 August 2022 at 02:20:31 UTC, Steven Schveighoffer
wrote:
On 8/4/22 9:51 PM, Paul Backus wrote:
Another option: use -vcg-ast, and have the compiler tell you
what it's actually calling. It's not ignoring that line, it's
just not doing what you think it's doing.
The output's not
On 8/4/22 9:51 PM, Paul Backus wrote:
On Friday, 5 August 2022 at 01:47:07 UTC, Ruby The Roobster wrote:
I found the issue: opOpAssign isn't getting called at all. I have no
idea why, though.
Given that the example works, the problem must be in some other part of
your code that you
On Friday, 5 August 2022 at 01:53:42 UTC, Ruby The Roobster wrote:
On Friday, 5 August 2022 at 01:38:48 UTC, jfondren wrote:
Here's a complete example that passes tests:
```d
struct S {
int n;
void opOpAssign(string op)(S rhs) if (op == "/") {
n++;
}
}
Nevermind. I have
On Friday, 5 August 2022 at 01:51:21 UTC, Ruby The Roobster wrote:
On Friday, 5 August 2022 at 01:47:07 UTC, Ruby The Roobster
wrote:
On Friday, 5 August 2022 at 01:42:23 UTC, jfondren wrote:
On Friday, 5 August 2022 at 01:38:48 UTC, jfondren wrote:
Here's a complete example that passes
On Friday, 5 August 2022 at 01:47:07 UTC, Ruby The Roobster wrote:
I found the issue: opOpAssign isn't getting called at all. I
have no idea why, though.
Given that the example works, the problem must be in some other
part of your code that you haven't posted. If you can post a more
On Friday, 5 August 2022 at 01:47:07 UTC, Ruby The Roobster wrote:
On Friday, 5 August 2022 at 01:42:23 UTC, jfondren wrote:
On Friday, 5 August 2022 at 01:38:48 UTC, jfondren wrote:
Here's a complete example that passes tests:
```d
struct S {
int n;
void opOpAssign(string op)(S rhs)
On Friday, 5 August 2022 at 01:42:23 UTC, jfondren wrote:
On Friday, 5 August 2022 at 01:38:48 UTC, jfondren wrote:
Here's a complete example that passes tests:
```d
struct S {
int n;
void opOpAssign(string op)(S rhs) if (op == "/") {
n++;
}
}
unittest {
auto a = S(1),
On Friday, 5 August 2022 at 01:38:48 UTC, jfondren wrote:
Here's a complete example that passes tests:
```d
struct S {
int n;
void opOpAssign(string op)(S rhs) if (op == "/") {
n++;
}
}
unittest {
auto a = S(1), b = S(2);
a /= b;
b /= a;
assert(a.n == 2);
On Friday, 5 August 2022 at 01:25:50 UTC, Ruby The Roobster wrote:
On Friday, 5 August 2022 at 01:23:40 UTC, Ruby The Roobster
wrote:
[SNIP]
Any function other than an operator overload seems to work
fine.
Also, this isn't mentioned in the spec.
Additional Information:
Fails for both DMD
On Friday, 5 August 2022 at 01:23:40 UTC, Ruby The Roobster wrote:
[SNIP]
Any function other than an operator overload seems to work fine.
Also, this isn't mentioned in the spec.
Additional Information:
Fails for both DMD and LDC on Windows x86_64 for dmd v2.100.1
How do I get unittests to actually execute operator overloads?
E.g.:
```d
struct Struct
{
void opOpAssign(string op)(Struct rhs) //Assume that the
operator `/=` is implemented here
{
//...
}
}
unittest
{
Struct a = Struct(1);
Struct b = Struct(2);
a /= b;
16 matches
Mail list logo