Skip to content

Commit

Permalink
Mark dynamic_buffer() result as nodiscard.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskohlhoff committed Feb 25, 2022
1 parent ad5cfd2 commit 177a5e8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions asio/include/asio/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2110,7 +2110,8 @@ class dynamic_vector_buffer
* @returns <tt>dynamic_string_buffer<Elem, Traits, Allocator>(data)</tt>.
*/
template <typename Elem, typename Traits, typename Allocator>
inline dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
ASIO_NODISCARD inline
dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
std::basic_string<Elem, Traits, Allocator>& data) ASIO_NOEXCEPT
{
return dynamic_string_buffer<Elem, Traits, Allocator>(data);
Expand All @@ -2122,7 +2123,8 @@ inline dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
* max_size)</tt>.
*/
template <typename Elem, typename Traits, typename Allocator>
inline dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
ASIO_NODISCARD inline
dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
std::basic_string<Elem, Traits, Allocator>& data,
std::size_t max_size) ASIO_NOEXCEPT
{
Expand All @@ -2134,7 +2136,8 @@ inline dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
* @returns <tt>dynamic_vector_buffer<Elem, Allocator>(data)</tt>.
*/
template <typename Elem, typename Allocator>
inline dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
ASIO_NODISCARD inline
dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
std::vector<Elem, Allocator>& data) ASIO_NOEXCEPT
{
return dynamic_vector_buffer<Elem, Allocator>(data);
Expand All @@ -2145,7 +2148,8 @@ inline dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
* @returns <tt>dynamic_vector_buffer<Elem, Allocator>(data, max_size)</tt>.
*/
template <typename Elem, typename Allocator>
inline dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
ASIO_NODISCARD inline
dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
std::vector<Elem, Allocator>& data,
std::size_t max_size) ASIO_NOEXCEPT
{
Expand Down

0 comments on commit 177a5e8

Please sign in to comment.