On Monday, 5 February 2024 at 23:23:36 UTC, Basile B. wrote:
>On Monday, 5 February 2024 at 19:16:40 UTC, Basile B. wrote:
>On Saturday, 3 February 2024 at 18:53:02 UTC, Carl Sturtivant wrote:
>[...]
What D does is "implicit" overload creation. If the same name already exists in the current scope it just creates an "overload set", adding possible candidates in a sort of linked list. There are restrictions however on what can be part of a set, for example you cannot overload a function declaration with an int declaration.
However this becomes complicated when it's about eponymous templates. There are probably still a couple of bugs related to that, because the way the semantics of a D program are checked does not allow to verify 100% of the time that the eponymous member(s) (yes plural) are all functions.
If you like, the way sets are created is cristal-clear but the way a member of the set is picked is more complex ;)
I can show you a case of overload set that's absurd. We knew exactly what to call. But we tought that overloads were better. That's when explicit overload declarations became clear. Why the heck do you need overload sets when you exactly know what has to be called 😏.
Just compile time lost. You know what to visit, just visit it ;)