diff --git a/src/common/io.h b/src/common/io.h index 07bb60787..2eb62b094 100644 --- a/src/common/io.h +++ b/src/common/io.h @@ -382,7 +382,8 @@ class PrivateMmapConstStream : public AlignedResourceReadStream { * @param length See the `length` parameter of `mmap` for details. */ explicit PrivateMmapConstStream(std::string path, std::size_t offset, std::size_t length) - : AlignedResourceReadStream{std::make_shared(path, offset, length)} {} + : AlignedResourceReadStream{std::shared_ptr{ // NOLINT + new MmapResource{std::move(path), offset, length}}} {} ~PrivateMmapConstStream() noexcept(false) override; };