Ticket #11748: boost_patch

File boost_patch, 809 bytes (added by ps06756@…, 7 years ago)

Patch for handling const char *

Line 
1diff --git a/include/boost/asio/buffer.hpp b/include/boost/asio/buffer.hpp
2index 729a31b..2f02c8a 100644
3--- a/include/boost/asio/buffer.hpp
4+++ b/include/boost/asio/buffer.hpp
5@@ -767,6 +767,16 @@ inline mutable_buffers_1 buffer(void* data, std::size_t size_in_bytes)
6 return mutable_buffers_1(mutable_buffer(data, size_in_bytes));
7 }
8
9+/// Create a new modifiable buffer that represents the given memory range.
10+/**
11+ * @returns <tt>mutable_buffers_1(data, size_in_bytes)</tt>
12+ */
13+inline mutable_buffers_1 buffer(const char* data, std::size_t size_in_bytes)
14+{
15+ return mutable_buffers_1(static_cast<void*>(const_cast<char*>(data)), size_in_bytes);
16+}
17+
18+
19 /// Create a new non-modifiable buffer that represents the given memory range.
20 /**
21 * @returns <tt>const_buffers_1(data, size_in_bytes)</tt>.