The daily D riddle

Jonathan M Davis newsgroup.d at jmdavisprog.com
Sun Jan 28 14:59:33 UTC 2018


On Sunday, January 28, 2018 01:52:58 Walter Bright via Digitalmars-d wrote:
> On 1/28/2018 12:36 AM, H. S. Teoh wrote:
> > Is there a practical use case for which this is actually useful?
>
> Generic code, where a member function doesn't need the instance to perform
> its task.

Maybe there's a situation where that would make sense, but personally, I
would consider static to be a core part of a function's API, and I would
expect it to be clear as to whether it needed access to an instance by its
very nature, in which case, it wouldn't make sense to have the same function
static in one type and not another and then be used generically.

- Jonathan M Davis



More information about the Digitalmars-d mailing list