Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7b88441

Browse files
committed
ADL lookup for operator<< working with std::ostream
This commit allows for easier output of the body contained in a message object.
1 parent8434182 commit7b88441

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

‎boost/network/message/wrappers/body.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ namespace boost { namespace network {
7777
returnboost::make_iterator_range(wrapper_base::_message.body());
7878
}
7979
};
80+
81+
template<classTag>
82+
inline std::ostream &operator<<(std::ostream & os, body_wrapper<Tag>const & body) {
83+
os <<static_cast<typename body_wrapper<Tag>::string_type>(body);
84+
return os;
85+
}
86+
87+
template<classTag>
88+
inline std::ostream &operator<<(std::ostream & os, body_wrapper_const<Tag>const & body) {
89+
os <<static_cast<typename body_wrapper_const<Tag>::string_type>(body);
90+
return os;
91+
}
8092

8193
}// namespace impl
8294

‎boost/network/protocol/http/message/wrappers/body.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ namespace boost { namespace network { namespace http {
3939
returnboost::make_iterator_range(message_.body());
4040
}
4141
};
42+
43+
template<classMessage>
44+
inline std::ostream &operator<<(std::ostream & os, body_wrapper<Message>const & body) {
45+
os <<static_cast<typename body_wrapper<Message>::string_type>(body);
46+
return os;
47+
}
4248

4349
}// namespace impl
4450

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp