Skip to content

Commit afd03a6

Browse files
authored
Fix build for AppleClang 11 (dmlc#9684)
1 parent f7da938 commit afd03a6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/common/ref_resource_view.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class RefResourceView {
7676

7777
[[nodiscard]] size_type size() const { return size_; } // NOLINT
7878
[[nodiscard]] size_type size_bytes() const { // NOLINT
79-
return Span{data(), size()}.size_bytes();
79+
return Span<const value_type>{data(), size()}.size_bytes();
8080
}
8181
[[nodiscard]] value_type* data() { return ptr_; }; // NOLINT
8282
[[nodiscard]] value_type const* data() const { return ptr_; }; // NOLINT

tests/cpp/common/test_io.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ TEST(IO, Resource) {
148148
fout << 1.0 << std::endl;
149149
fout.close();
150150

151-
auto resource = std::make_shared<MmapResource>(path, 0, sizeof(double));
151+
auto resource = std::shared_ptr<MmapResource>{
152+
new MmapResource{path, 0, sizeof(double)}};
152153
ASSERT_EQ(resource->Size(), sizeof(double));
153154
ASSERT_EQ(resource->Type(), ResourceHandler::kMmap);
154155
ASSERT_EQ(resource->DataAs<double>()[0], val);

0 commit comments

Comments
 (0)