Add ref-qualified overloads for message::body

This commit is contained in:
Vinnie Falco
2017-10-30 15:23:43 -07:00
parent e39e4c73bf
commit 23bf8638ab
5 changed files with 55 additions and 3 deletions
+24 -2
View File
@@ -849,7 +849,7 @@ struct message
#else
detail::value_type_t<Body>&
#endif
body() noexcept
body()& noexcept
{
return this->member();
}
@@ -860,11 +860,33 @@ struct message
#else
detail::value_type_t<Body> const&
#endif
body() const noexcept
body() const& noexcept
{
return this->member();
}
/// Returns the body
#if BOOST_BEAST_DOXYGEN || ! defined(BOOST_MSVC)
typename body_type::value_type&&
#else
detail::value_type_t<Body>&&
#endif
body()&& noexcept
{
return std::move(this->member());
}
/// Returns the body
#if BOOST_BEAST_DOXYGEN || ! defined(BOOST_MSVC)
typename body_type::value_type const&&
#else
detail::value_type_t<Body> const&&
#endif
body() const&& noexcept
{
return std::move(this->member());
}
private:
static_assert(is_body<Body>::value,
"Body requirements not met");