Skip to content

Commit

Permalink
Fix build for AppleClang 11 (#9684) (#9693)
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 authored Oct 18, 2023
1 parent 5d1bcde commit 3b86260
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/ref_resource_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class RefResourceView {

[[nodiscard]] size_type size() const { return size_; } // NOLINT
[[nodiscard]] size_type size_bytes() const { // NOLINT
return Span{data(), size()}.size_bytes();
return Span<const value_type>{data(), size()}.size_bytes();
}
[[nodiscard]] value_type* data() { return ptr_; }; // NOLINT
[[nodiscard]] value_type const* data() const { return ptr_; }; // NOLINT
Expand Down
3 changes: 2 additions & 1 deletion tests/cpp/common/test_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ TEST(IO, Resource) {
fout << 1.0 << std::endl;
fout.close();

auto resource = std::make_shared<MmapResource>(path, 0, sizeof(double));
auto resource = std::shared_ptr<MmapResource>{
new MmapResource{path, 0, sizeof(double)}};
ASSERT_EQ(resource->Size(), sizeof(double));
ASSERT_EQ(resource->Type(), ResourceHandler::kMmap);
ASSERT_EQ(resource->DataAs<double>()[0], val);
Expand Down

0 comments on commit 3b86260

Please sign in to comment.