diff --git a/CHANGELOG b/CHANGELOG index ef388f19..b223e8a3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ 1.0.0-b6 +* Use SFINAE on return values +* Use beast::error_code instead of nested types + -------------------------------------------------------------------------------- diff --git a/TODO.txt b/TODO.txt index c8485516..00cb1054 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,9 +1,5 @@ * Add writer::prepare(msg&) interface to set Content-Type -General: -* Use SFINAE on return values (search for "class =") -* Remove http,websocket error_code types and use the one in - Boost.Http * Use enum instead of bool in isRequest * move version to a subclass of message diff --git a/include/beast/core/to_string.hpp b/include/beast/core/to_string.hpp index 41ba8d0f..c415fd5c 100644 --- a/include/beast/core/to_string.hpp +++ b/include/beast/core/to_string.hpp @@ -25,15 +25,16 @@ namespace beast { @return A string representing the contents of the input area. @note This function participates in overload resolution only if - the streambuf parameter meets the requirements of @b `Streambuf`. + the buffers parameter meets the requirements of @b `ConstBufferSequence`. */ -template::value> -#endif -> +template +#if GENERATING_DOCS std::string +#else +typename std::enable_if< + is_ConstBufferSequence::value, + std::string>::type +#endif to_string(ConstBufferSequence const& buffers) { using boost::asio::buffer_cast; diff --git a/include/beast/http/basic_headers.hpp b/include/beast/http/basic_headers.hpp index 6e034e27..38b3d3ee 100644 --- a/include/beast/http/basic_headers.hpp +++ b/include/beast/http/basic_headers.hpp @@ -401,10 +401,9 @@ public: If a field value already exists the new value will be extended as per RFC2616 Section 4.2. */ - template::value>::type> - void + template + typename std::enable_if< + ! std::is_constructible::value>::type insert(boost::string_ref name, T const& value) { insert(name, @@ -414,7 +413,7 @@ public: /** Replace a field value. The current field value, if any, is removed. Then the - specified value is inserted as if by insert(field, value). + specified value is inserted as if by `insert(field, value)`. */ void replace(boost::string_ref const& name, @@ -423,12 +422,11 @@ public: /** Replace a field value. The current field value, if any, is removed. Then the - specified value is inserted as if by insert(field, value). + specified value is inserted as if by `insert(field, value)`. */ - template::value>::type> - void + template + typename std::enable_if< + ! std::is_constructible::value>::type replace(boost::string_ref const& name, T const& value) { replace(name,