writef, compile-checked format, pointer

novice2 sorry at noem.ail
Mon Aug 9 19:38:28 UTC 2021


format!"fmt"() and writef!"fmt"() templates
with compile-time checked format string
not accept %X for pointers,

but format() and writef() accept it

https://run.dlang.io/is/aQ05Ux
```
void main() {
     import std.stdio: writefln;
     int x;
     writefln("%X", &x);  //ok
     writefln!"%s"(&x);  //ok
     //writefln!"%X"(&x);  //compile error
}
```

is this intentional?


More information about the Digitalmars-d-learn mailing list