-
-
Notifications
You must be signed in to change notification settings - Fork 746
std.socket: Decorate Socket methods #4273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does const on a void method make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@safe pure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.