On 6/9/23 06:05, An Pham wrote:
Getting with below error for following codes. Look like bug?
onlineapp.d(61): Error: scope variable `a` assigned to non-scope
parameter `a` calling `foo`
@safe:
struct A(S = string)
{
@safe:
S s;
void delegate() c;
}
Please consider:
```
void main() {
import std.stdio;
struct foo {
int foo1;
char foo2;
}
foo* fooptr;
void* genptr;
static if (is(typeof(fooptr) == void*))
writeln("fooptr is void*");
else
writeln("fooptr is not void*");
On Sunday, 11 June 2023 at 21:25:21 UTC, DLearner wrote:
Please consider:
```
void main() {
import std.stdio;
struct foo {
int foo1;
char foo2;
}
foo* fooptr;
void* genptr;
static if (is(typeof(fooptr) == void*))
writeln("fooptr is void*");
std.traits : isPointer
or
``is(int* : T*, T)``
Just to be clear where the argument goes (from templates parameters ext.):
``is(InputType : T*, T)``