Skip to content

Commit f1458dd

Browse files
Fix C++20 ranges compatibility in node_options.cc
GCC 11's split_view subranges don't have .data() and .size() methods. Use std::ranges::copy with back_inserter to build the destination string instead. Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
1 parent ed9f2d3 commit f1458dd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/node_options.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ void DebugOptions::CheckOptions(std::vector<std::string>* errors,
6363
inspect_publish_uid.console = false;
6464
inspect_publish_uid.http = false;
6565
for (const auto& entry : entries) {
66-
std::string_view destination(entry.data(), entry.size());
66+
// Use std::ranges::copy for GCC 11 C++20 compatibility
67+
// (split_view subranges don't have .data() and .size())
68+
std::string destination;
69+
std::ranges::copy(entry, std::back_inserter(destination));
6770
if (destination == "stderr"sv) {
6871
inspect_publish_uid.console = true;
6972
} else if (destination == "http"sv) {

0 commit comments

Comments
 (0)