```d
struct Test
{
int n;
float f;
static Test opCall(int n, float f)
{
return Test(n, f);
}
}
void main()
{
Test(1, 2.0);
}
```
This code causes an infinite loop because the `Test(n, f)` inside
the static `opCall` is interpreted as a recursive call to that
sam
On Friday, 28 February 2025 at 23:31:23 UTC, Meta wrote:
```d
struct Test
{
int n;
float f;
static Test opCall(int n, float f)
{
return Test(n, f);
}
}
void main()
{
Test(1, 2.0);
}
```
This code causes an infinite loop because the `Test(n, f)`
inside the stati
On Saturday, 1 March 2025 at 00:47:20 UTC, Paul Backus wrote:
What you can do is use curly-brace initialization syntax:
```d
struct Test
{
int n;
float f;
static Test opCall(int n, float f)
{
Test result = { n, f };
return result;
}
}
void main()
{
auto
On Saturday, 1 March 2025 at 02:19:55 UTC, Meta wrote:
On Saturday, 1 March 2025 at 00:47:20 UTC, Paul Backus wrote:
What you can do is use curly-brace initialization syntax:
Thanks, I forgot about that syntax. Another question I have is
if there's a way to do this inline:
No, there's no w
On Thursday, 27 February 2025 at 08:16:33 UTC, John C. wrote:
On Thursday, 27 February 2025 at 08:10:04 UTC, John C. wrote:
would removing some "hard to parse" constructs in header file
help this situation?
I tried to change
```
#define LIGHTGRAY CLITERAL(Color){ 200, 200, 200, 255 }
On Saturday, 1 March 2025 at 02:19:55 UTC, Meta wrote:
Thanks, I forgot about that syntax. Another question I have is
if there's a way to do this inline:
```d
struct Test
{
int n;
float f;
static Test opCall(int n, float f)
{
//return {n, f};Error