Need typecast operator to (const sockaddr) for IPAddress #43

Closed
wants to merge 42 commits into from

2 participants

@pprindeville

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.

@aleks-f
POCO C++ Libraries member

already fixed:

pocoproject@94cec18

@aleks-f
POCO C++ Libraries member
@aleks-f
POCO C++ Libraries member
@aleks-f
POCO C++ Libraries member

I'm a little bit worried about this one breaking some platforms

@aleks-f aleks-f was assigned Dec 26, 2012
@aleks-f
POCO C++ Libraries member

What is the purpose of returning const value?

@pprindeville

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?

@aleks-f
POCO C++ Libraries 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/

@pprindeville

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.

@pprindeville

Please pull into develop.

@pprindeville

Please pull upstream.

Note that Crypto and Data don't build because of other linkage issues involving libkrb5.a and libsqlite3.a

@aleks-f
POCO C++ Libraries member

there's too many commits in this pull request, closing

@aleks-f aleks-f closed this Jan 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment