Skip to content

Commit ed9f2d3

Browse files
Fix C++20 ranges compatibility with GCC 11
GCC 11's std::string doesn't have a constructor that accepts ranges iterators with different iterator/sentinel types from std::ranges::split_view. Use std::ranges::copy with back_inserter instead. Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
1 parent e7ee292 commit ed9f2d3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/node_v8_platform-inl.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ struct V8Platform {
111111
[](auto& categories) -> std::set<std::string> {
112112
std::set<std::string> out;
113113
for (const auto& s : categories) {
114-
out.emplace(std::string(std::ranges::begin(s), std::ranges::end(s)));
114+
// Use std::ranges::copy instead of string iterator constructor
115+
// for GCC 11 C++20 compatibility
116+
std::string str;
117+
std::ranges::copy(s, std::back_inserter(str));
118+
out.emplace(std::move(str));
115119
}
116120
return out;
117121
};

0 commit comments

Comments
 (0)