Refactor type_traits (API Change):

fix #373

* concepts.hpp is renamed to type_traits.hpp

* Body reader and writer concepts are renamed
This commit is contained in:
Vinnie Falco
2017-05-28 16:00:05 -07:00
parent 8578419433
commit c29451a8dd
32 changed files with 435 additions and 462 deletions
+6 -8
View File
@@ -10,7 +10,7 @@
#include <beast/core/error.hpp>
#include <beast/core/string_view.hpp>
#include <beast/http/concepts.hpp>
#include <beast/http/type_traits.hpp>
#include <beast/http/rfc7230.hpp>
#include <beast/core/detail/ci_char_traits.hpp>
#include <beast/core/detail/type_traits.hpp>
@@ -130,7 +130,7 @@ prepare_content_length(prepare_info& pi,
message<isRequest, Body, Fields> const& msg,
std::true_type)
{
typename Body::writer w(msg);
typename Body::reader w{msg};
// VFALCO This is a design problem!
error_code ec;
w.init(ec);
@@ -159,15 +159,13 @@ prepare(message<isRequest, Body, Fields>& msg,
Options&&... options)
{
// VFALCO TODO
static_assert(is_Body<Body>::value,
static_assert(is_body<Body>::value,
"Body requirements not met");
static_assert(has_writer<Body>::value,
"Body has no writer");
static_assert(is_Writer<Body>::value,
"Writer requirements not met");
static_assert(is_body_reader<Body>::value,
"BodyReader requirements not met");
detail::prepare_info pi;
detail::prepare_content_length(pi, msg,
detail::has_content_length<typename Body::writer>{});
detail::has_content_length<typename Body::reader>{});
detail::prepare_options(pi, msg,
std::forward<Options>(options)...);