Regarding the proposed Binray Literals Deprecation
Zealot
no2 at no.no
Wed Sep 21 12:12:52 UTC 2022
On Wednesday, 21 September 2022 at 11:50:16 UTC, Quirin Schroll
wrote:
> On Wednesday, 14 September 2022 at 05:58:53 UTC, Walter Bright
> wrote:
>> [...]
> ```D
> void F(T)(T* ptr)
> {
> pragma(msg, T); // prints void()
> }
> void main()
> {
> void function() f = { };
> F(f);
> }
> ```
> If you try making `f` a delegate, the call `F(f)` cannot
> resolve `T` (obviously).
>
> [...]
```
alias F = void function(int, double);
enum:F{ f1 = (i, d) { writeln("f1"); }}
enum:F{ f2 = (i, d) { writeln("f2"); }}
```
or
```
alias F = void function(int, double);
enum:F {
f1 = (i, d) { },
f2 = (i, d) { }
}
```
so i'd say this should work too
```
enum:F f1 = (i, d) { };
```
More information about the Digitalmars-d
mailing list