Use SFINAE on return values

This commit is contained in:
Vinnie Falco
2017-07-20 08:12:07 -07:00
parent 472d90eb3b
commit 8686b28cf2
4 changed files with 19 additions and 21 deletions
+8 -7
View File
@@ -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;