std.socket: Decorate Socket methods#4273
Conversation
|
LGTM other than the 32 bit issues. |
| * returns immediately and the connection attempt is still in progress. | ||
| */ | ||
| void connect(Address to) @trusted | ||
| void connect(Address to) @trusted const |
There was a problem hiding this comment.
Does const on a void method make sense?
There was a problem hiding this comment.
Yes? It means that the object itself will not be modified.
A different question would be, does const on a method that mutates the state of what it is representing (OS socket) make sense?
There was a problem hiding this comment.
const applies to this pointer so obviously yes
|
Gahhh. So I think this is a case where it should be turned into a |
Me thinks yes |
|
Oh, as it turns out that's not even necessary because |
8b25a15 to
4cbaa55
Compare
|
Auto-merge toggled on |
4cbaa55 to
ebb379f
Compare
| */ | ||
| enum int ERROR = _SOCKET_ERROR; | ||
|
|
||
| private static int capToInt(size_t size) nothrow @nogc |
There was a problem hiding this comment.
@safe is implicit (declared at the top of the module). pure makes no difference here because it is a private method called only by non-pure methods.
|
This pull request introduced a regression: |
In particular,
send/receiveweren't@nogc.