mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 21:34:46 +02:00
Use SFINAE on return values
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
1.0.0-b6
|
||||
|
||||
* Use SFINAE on return values
|
||||
* Use beast::error_code instead of nested types
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
4
TODO.txt
4
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 <beast/error.hpp>
|
||||
|
||||
Boost.Http
|
||||
* Use enum instead of bool in isRequest
|
||||
* move version to a subclass of message
|
||||
|
@@ -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<class ConstBufferSequence
|
||||
#if ! GENERATING_DOCS
|
||||
,class = std::enable_if<is_ConstBufferSequence<
|
||||
ConstBufferSequence>::value>
|
||||
#endif
|
||||
>
|
||||
template<class ConstBufferSequence>
|
||||
#if GENERATING_DOCS
|
||||
std::string
|
||||
#else
|
||||
typename std::enable_if<
|
||||
is_ConstBufferSequence<ConstBufferSequence>::value,
|
||||
std::string>::type
|
||||
#endif
|
||||
to_string(ConstBufferSequence const& buffers)
|
||||
{
|
||||
using boost::asio::buffer_cast;
|
||||
|
@@ -401,10 +401,9 @@ public:
|
||||
If a field value already exists the new value will be
|
||||
extended as per RFC2616 Section 4.2.
|
||||
*/
|
||||
template<class T,
|
||||
class = typename std::enable_if<
|
||||
! std::is_constructible<boost::string_ref, T>::value>::type>
|
||||
void
|
||||
template<class T>
|
||||
typename std::enable_if<
|
||||
! std::is_constructible<boost::string_ref, T>::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<class T,
|
||||
class = typename std::enable_if<
|
||||
! std::is_constructible<boost::string_ref, T>::value>::type>
|
||||
void
|
||||
template<class T>
|
||||
typename std::enable_if<
|
||||
! std::is_constructible<boost::string_ref, T>::value>::type
|
||||
replace(boost::string_ref const& name, T const& value)
|
||||
{
|
||||
replace(name,
|
||||
|
Reference in New Issue
Block a user