Skip to content

Commit

Permalink
temporary_buffer: make nothrow default constructible
Browse files Browse the repository at this point in the history
Required for making iostreams nothrow move constructible.
Note that it is already nothrow_move_constructible.

Signed-off-by: Benny Halevy <[email protected]>
  • Loading branch information
bhalevy committed Jun 7, 2020
1 parent e83293c commit 3b8a6bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/seastar/core/temporary_buffer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public:
}
//explicit temporary_buffer(CharType* borrow, size_t size) : _buffer(borrow), _size(size) {}
/// Creates an empty \c temporary_buffer that does not point at anything.
temporary_buffer()
temporary_buffer() noexcept
: _buffer(nullptr)
, _size(0) {}
temporary_buffer(const temporary_buffer&) = delete;
Expand Down
3 changes: 3 additions & 0 deletions src/core/fstream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ static_assert(std::is_nothrow_move_constructible_v<data_source>);
static_assert(std::is_nothrow_constructible_v<data_sink>);
static_assert(std::is_nothrow_move_constructible_v<data_sink>);

static_assert(std::is_nothrow_constructible_v<temporary_buffer<char>>);
static_assert(std::is_nothrow_move_constructible_v<temporary_buffer<char>>);

class file_data_source_impl : public data_source_impl {
struct issued_read {
uint64_t _pos;
Expand Down

0 comments on commit 3b8a6bc

Please sign in to comment.