Reimplementing the bulk of std.meta iteratively

Steven Schveighoffer schveiguy at gmail.com
Tue Sep 29 20:04:45 UTC 2020


On 9/29/20 3:32 PM, Adam D. Ruppe wrote:
> On Tuesday, 29 September 2020 at 14:07:14 UTC, Andrei Alexandrescu wrote:
>> As things are now, AAs don't quite behave like any other things.
> 
> The biggest difference I see is how null works, the keyword.
> 
> void foo(string[string] aa) {}
> 
> foo(null); // works.
> 
> But that's outright impossible with a library struct.
> 
> yes, I'm bringing up my wish for implicit construction again :P

This is certainly an odd duck. I don't really want to have the language 
provide all-out implicit construction, but possibly a mechanism to say 
"I can be implicitly constructed from null" would be useful.

null is in its own category of literals, it can change into just about 
anything (class, pointer, array associative array). Another nice place 
this would be useful is std.typecons.Nullable.

-Steve


More information about the Digitalmars-d mailing list