Remove use of lexical_cast

This commit is contained in:
Vinnie Falco
2017-07-23 17:34:41 -07:00
parent 7139dd639a
commit b97586b318
16 changed files with 134 additions and 41 deletions
+9 -2
View File
@@ -46,10 +46,17 @@ public:
std::string
to_string(ConstBufferSequence const& bs)
{
return boost::lexical_cast<
std::string>(buffers(bs));
using boost::asio::buffer_cast;
using boost::asio::buffer_size;
std::string s;
s.reserve(buffer_size(bs));
for(boost::asio::const_buffer b : bs)
s.append(buffer_cast<char const*>(b),
buffer_size(b));
return s;
}
struct con
{
stream<socket_type> ws;