Need typecast operator to (const sockaddr) for IPAddress#43
Closed
pprindeville wants to merge 42 commits intopocoproject:developfrom
Closed
Need typecast operator to (const sockaddr) for IPAddress#43pprindeville wants to merge 42 commits intopocoproject:developfrom
pprindeville wants to merge 42 commits intopocoproject:developfrom
Conversation
…erfaces as one operation, then filter based on IP/UP status as a separate operation.
…ors, temporary variables, etc.
Member
|
What is the purpose of returning const value? |
Contributor
Author
|
As I remember, when returning a temporary object it needs to be returned as a const. Didn't we see a similar problem once before with the BinaryReader class? |
Member
|
Only if you are assigning temporary to non-const reference; compiler will tell you about it. http://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/ |
Contributor
Author
|
Well, since it needs to be assigned to a const reference in that case, returning the temporary as a const wouldn't break anything and serves as a reminder that it's an ephemeral object. Either way, it's fine. I'd prefer it as a const, but I'm not adamant about it. |
Member
|
there's too many commits in this pull request, closing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are some operations (like POSIX system calls, e.g. ioctl, setsockopt, etc) that require a sockaddr.
Having a cast operator to sockaddr would simplify setting up such operations.