Re: Problem with dmd-2.104.0 -dip1000 & @safe

2023-06-11 Thread Timon Gehr via Digitalmars-d-learn
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;     }

compile-time detection of all pointer types in one test

2023-06-11 Thread DLearner via Digitalmars-d-learn
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*");

Re: compile-time detection of all pointer types in one test

2023-06-11 Thread Andy via Digitalmars-d-learn
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*");

Re: compile-time detection of all pointer types in one test

2023-06-11 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
std.traits : isPointer or ``is(int* : T*, T)``

Re: compile-time detection of all pointer types in one test

2023-06-11 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Just to be clear where the argument goes (from templates parameters ext.): ``is(InputType : T*, T)``