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

Commit5e47bea

Browse files
committed
Implementing an overload to the top-level clear_headers algorithm.
1 parente182a57 commit5e47bea

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_CLEAR_HEADER_HPP_20101128
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_CLEAR_HEADER_HPP_20101128
3+
4+
#include<boost/network/protocol/http/support/client_or_server.hpp>
5+
#include<boost/network/support/is_async.hpp>
6+
#include<boost/thread/future.hpp>
7+
8+
namespaceboost {namespacenetwork {namespacehttp {
9+
10+
namespaceimpl {
11+
12+
template<classTag>
13+
inlinetypename enable_if<
14+
is_client<Tag>
15+
,void
16+
>::type
17+
clear_headers(basic_request<Tag> & request) {
18+
request.headers(typename basic_request<Tag>::headers_container_type());
19+
}
20+
21+
}/* impl*/
22+
23+
template<classTag>
24+
inlinevoidclear_headers_impl(basic_request<Tag> & request, tags::client) {
25+
impl::clear_headers(request);
26+
}
27+
28+
template<classTag>
29+
inlinevoidclear_headers_impl(basic_request<Tag> & request, tags::server) {
30+
typedeftypename basic_request<Tag>::headers_container_type headers_container;
31+
headers_container().swap(request.headers);
32+
}
33+
34+
template<classTag>
35+
inlinevoidclear_headers(basic_request<Tag> & request) {
36+
clear_headers_impl(request,typename client_or_server<Tag>::type());
37+
}
38+
39+
}/* http*/
40+
41+
}/* network*/
42+
43+
}/* boost*/
44+
45+
#endif/* BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_CLEAR_HEADER_HPP_20101128*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp