diff options
Diffstat (limited to 'include/salticidae/netaddr.h')
-rw-r--r-- | include/salticidae/netaddr.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/salticidae/netaddr.h b/include/salticidae/netaddr.h index eabb5da..5639c1b 100644 --- a/include/salticidae/netaddr.h +++ b/include/salticidae/netaddr.h @@ -92,8 +92,10 @@ struct NetAddr { operator std::string() const { struct in_addr in; in.s_addr = ip; - return "<NetAddr " + std::string(inet_ntoa(in)) + - ":" + std::to_string(ntohs(port)) + ">"; + DataStream s; + s << "<NetAddr " << std::string(inet_ntoa(in)) + << ":" << std::to_string(ntohs(port)) << ">"; + return std::move(s); } bool is_null() const { return ip == 0 && port == 0; } |