Skip to content

Commit

Permalink
apacheGH-41024: [C++] IO: fixing compiling in gcc 7.5.0 (apache#41025)
Browse files Browse the repository at this point in the history
### Rationale for this change

Previous pr ( apache#39807 ) remove std::move when returning value, however, it's not allowed in some old compilers

### What changes are included in this PR?

add std::move for return, and add reason for that

### Are these changes tested?

Should test by other ci

### Are there any user-facing changes?

no

* GitHub Issue: apache#41024

Authored-by: mwish <maplewish117@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
mapleFU authored Apr 5, 2024
1 parent 074d45f commit 110efed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cpp/src/arrow/io/compressed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ class CompressedInputStream::Impl {
ARROW_ASSIGN_OR_RAISE(auto buf, AllocateResizableBuffer(nbytes, pool_));
ARROW_ASSIGN_OR_RAISE(int64_t bytes_read, Read(nbytes, buf->mutable_data()));
RETURN_NOT_OK(buf->Resize(bytes_read));
return buf;
// Using std::move because the some compiler might has issue below:
// https://wg21.cmeerw.net/cwg/issue1579
return std::move(buf);
}

const std::shared_ptr<InputStream>& raw() const { return raw_; }
Expand Down

0 comments on commit 110efed

Please sign in to comment.