What does dual-context mean?

wjoe wjoe at example.com
Tue Mar 1 14:51:47 UTC 2022


Hello,

what's a dual context as in the deprecation message?

```d
struct MockFile {
   [...]

   void writef(alias fmt, A...)(A args) { // Deprecation: function 
'writef': function requires a dual-context, which is deprecated
     import std.format: format;
     write(format!fmt(args));
   }

   [...]
}

unittest {
   auto f = MockFile();
   immutable fmt = "%d";
   f.writef!fmt(0); // instatiated from here
}
```




More information about the Digitalmars-d-learn mailing list