Named Arguments Status Update - Overloading by name

jmh530 john.michael.hall at gmail.com
Wed Apr 10 14:00:34 UTC 2024


On Wednesday, 10 April 2024 at 13:47:19 UTC, bachmeier wrote:
> [snip]
>
> I learned about it from the properties chapter in Ali's book: 
> http://ddili.org/ders/d.en/property.html
>
> It's particularly useful for clean interfaces when you're 
> wrapping structs allocated by a C library. You may have to do 
> various operations behind the scenes, like converting D strings 
> to their C counterparts so the data can be used internally, but 
> you still want to be able to work with it in the natural way 
> `x.names = ["blue", "green", "red"]`.

I knew you could do that with member functions, just never 
thought to do it with normal functions. Thanks!


More information about the Digitalmars-d mailing list