Skip to content

Commit 3c22daa

Browse files
committed
Using concept requirements on the generator functions for the HTTP message wrappers.
1 parent 3226720 commit 3c22daa

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

boost/network/protocol/http/message/wrappers/status.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
#include <boost/cstdint.hpp>
1111

12+
#include <boost/network/protocol/http/response_concept.hpp>
13+
#include <boost/concept/requires.hpp>
14+
1215
namespace boost { namespace network { namespace http {
1316

1417
template <class Tag>
@@ -36,7 +39,10 @@ namespace boost { namespace network { namespace http {
3639
} // namespace impl
3740

3841
template <class Tag>
39-
inline impl::status_wrapper<Tag> status(basic_response<Tag> const & response) {
42+
inline
43+
BOOST_CONCEPT_REQUIRES(((Response<basic_response<Tag> >)),
44+
(impl::status_wrapper<Tag>))
45+
status(basic_response<Tag> const & response) {
4046
return impl::status_wrapper<Tag>(response);
4147
}
4248

boost/network/protocol/http/message/wrappers/status_message.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// (See accompanying file LICENSE_1_0.txt or copy at
88
// http://www.boost.org/LICENSE_1_0.txt)
99

10+
#include <boost/concept/requires.hpp>
11+
1012
namespace boost { namespace network { namespace http {
1113

1214
template <class Tag>
@@ -36,7 +38,11 @@ namespace boost { namespace network { namespace http {
3638
} // namespace impl
3739

3840
template <class Tag>
39-
inline impl::status_message_wrapper<Tag> status_message(basic_response<Tag> const & response) {
41+
inline
42+
BOOST_CONCEPT_REQUIRES(
43+
((Response<basic_response<Tag> >)),
44+
(impl::status_message_wrapper<Tag>))
45+
status_message(basic_response<Tag> const & response) {
4046
return impl::status_message_wrapper<Tag>(response);
4147
}
4248

boost/network/protocol/http/message/wrappers/version.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// (See accompanying file LICENSE_1_0.txt or copy at
88
// http://www.boost.org/LICENSE_1_0.txt)
99

10-
#include <boost/network/tags.hpp>
10+
#include <boost/concept/requires.hpp>
1111

1212
namespace boost { namespace network { namespace http {
1313

@@ -38,7 +38,11 @@ namespace boost { namespace network { namespace http {
3838
} // namespace impl
3939

4040
template <class Tag>
41-
inline impl::version_wrapper<Tag> version(basic_response<Tag> const & response) {
41+
inline
42+
BOOST_CONCEPT_REQUIRES(
43+
((Response<basic_response<Tag> >)),
44+
(impl::version_wrapper<Tag>))
45+
version(basic_response<Tag> const & response) {
4246
return impl::version_wrapper<Tag>(response);
4347
}
4448

0 commit comments

Comments
 (0)