]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/socket.cpp
Use nullptr instead of 0 for pointers
[libs/net.git] / source / net / socket.cpp
index 9fd468ef84111175c620dc216932c1c387bbac26..67bd38137dbe58eba6d76c51df553d90b4f0d3e3 100644 (file)
@@ -11,8 +11,7 @@ namespace Msp {
 namespace Net {
 
 Socket::Socket(const Private &p):
-       priv(new Private),
-       local_addr(0)
+       priv(new Private)
 {
        mode = IO::M_RDWR;
 
@@ -26,8 +25,7 @@ Socket::Socket(const Private &p):
 }
 
 Socket::Socket(Family af, int type, int proto):
-       priv(new Private),
-       local_addr(0)
+       priv(new Private)
 {
        mode = IO::M_RDWR;
 
@@ -82,7 +80,7 @@ void Socket::bind(const SockAddr &addr)
 
 const SockAddr &Socket::get_local_address() const
 {
-       if(local_addr==0)
+       if(!local_addr)
                throw bad_socket_state("not bound");
        return *local_addr;
 }