[Issue 16514] std.socket methods are const, and thus cannot be overriden for SSLSocket, for example

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Oct 13 00:36:15 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16514

--- Comment #5 from Ketmar Dark <ketmar at ketmar.no-ip.org> ---
i'd say that for AA it is way better (at least in this case) to subclass the
thing with new opHash implementation. also, `const` Socket has very little
sense: despite being `const`, it is still changing some of it's internal state.
slapping `const` usually means "it should not change while i holding it", but
this is not the case for open Socket (OS doesn't know about that restriction
;-).

i.e. i see no sense in trying to *pretend* that const Socket has any meaning:
it is confusing and mostly useless.

--


More information about the Digitalmars-d-bugs mailing list