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

Commitba96b4f

Browse files
committed
SFINAE-ize the server_base metafunction
The server_base metafunction type serves as a means for choosing which implementation basethe server will be deriving from. The SFINAE technique is used to enable the appropriateimplementation of the type depending on the tag dispatch mechanism being utilized throughoutthe implementation.
1 parent9b9bd9b commitba96b4f

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

‎boost/network/protocol/http/server.hpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,21 @@
1616
#include<boost/network/protocol/http/server/parameters.hpp>
1717

1818
namespaceboost {namespacenetwork {namespacehttp {
19-
19+
20+
template<classTag,classHandler,classEnable =void>
21+
structserver_base {
22+
typedef unsupported_tag<Tag> type;
23+
};
24+
2025
template<classTag,classHandler>
21-
structserver_base :
22-
mpl::if_<
23-
is_async<Tag>
24-
, async_server_base<Tag, Handler>
25-
,typename mpl::if_<
26-
is_sync<Tag>
27-
, sync_server_base<Tag, Handler>
28-
, unsupported_tag<Tag>
29-
>::type
30-
>
31-
{};
26+
structserver_base<Tag, Handler,typename enable_if<is_async<Tag> >::type> {
27+
typedef async_server_base<Tag, Handler> type;
28+
};
29+
30+
template<classTag,classHandler>
31+
structserver_base<Tag, Handler,typename enable_if<is_sync<Tag> >::type> {
32+
typedef sync_server_base<Tag, Handler> type;
33+
};
3234

3335
template<classTag,classHandler>
3436
structbasic_server : server_base<Tag, Handler>::type

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp