Use SFINAE on return values

This commit is contained in:
Vinnie Falco
2016-05-27 11:10:45 -04:00
parent 803d145a5e
commit cd41a0decd
4 changed files with 19 additions and 21 deletions

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;