Skip to content

Commit 348cada

Browse files
committed
Updating concept implementation and headers wrapper.
1 parent 9c82976 commit 348cada

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

boost/network/message/message_concept.hpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@ struct Message
2727
M message_;
2828
swap(message, message_);
2929

30-
headers_container_type &headers_ = message.headers();
31-
string_type &body_ = message.body();
32-
string_type &source_ = message.source();
33-
string_type &destination_ = message.destination();
30+
headers_container_type headers_ = headers(message);
31+
string_type body_ = body(message);
32+
string_type source_ = source(message);
33+
string_type destination_ = destination(message);
34+
35+
message << source(string_type())
36+
<< destination(string_type())
37+
<< header(string_type(), string_type())
38+
<< body(string_type());
3439

3540
(void)headers_;
3641
(void)body_;

boost/network/message/wrappers/headers.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ namespace boost { namespace network {
3434
* headers_range<basic_message<tag> >::type
3535
* Which allows for full range support.
3636
*
37+
* The type is also convertible to a
38+
* headers_container<Tag>::type
39+
* Which copies the headers from the wrapped message.
40+
*
3741
*/
3842
namespace impl {
3943
template <class Tag>
@@ -70,6 +74,10 @@ namespace boost { namespace network {
7074
return make_iterator_range(headers_wrapper<Tag>::_message.headers().begin(), headers_wrapper<Tag>::_message.headers().end());
7175
};
7276

77+
operator headers_container_type () {
78+
return headers_wrapper<Tag>::_message.headers();
79+
}
80+
7381
};
7482
} // namespace impl
7583

0 commit comments

Comments
 (0)