Skip to content

Commit 1e01c52

Browse files
authored
apacheGH-46998: [C++] Fix mockfs.cc compiling error with C++23 (apache#46999)
### Rationale for this change When compiling with C++23, mockfs.cc fails due to a static assertion failure, as described in issue apache#46998. ### What changes are included in this PR? Move the implementation of AssignEntry after the definition of Entry. ### Are these changes tested? Yes, I test the changes with C++23, and the error gone. ### Are there any user-facing changes? No, the changes are within an anonymous namespace. * GitHub Issue: apache#46998 Authored-by: Junwang Zhao <zhjwpku@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 56c0e2f commit 1e01c52

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

cpp/src/arrow/filesystem/mockfs.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@ struct Directory {
108108
return p.second;
109109
}
110110

111-
void AssignEntry(const std::string& s, std::unique_ptr<Entry> entry) {
112-
DCHECK(!s.empty());
113-
entries[s] = std::move(entry);
114-
}
111+
void AssignEntry(const std::string& s, std::unique_ptr<Entry> entry);
115112

116113
bool DeleteEntry(const std::string& s) { return entries.erase(s) > 0; }
117114

@@ -187,6 +184,11 @@ class Entry : public EntryBase {
187184
ARROW_DISALLOW_COPY_AND_ASSIGN(Entry);
188185
};
189186

187+
void Directory::AssignEntry(const std::string& s, std::unique_ptr<Entry> entry) {
188+
DCHECK(!s.empty());
189+
entries[s] = std::move(entry);
190+
}
191+
190192
////////////////////////////////////////////////////////////////////////////
191193
// Streams
192194

0 commit comments

Comments
 (0)