Skip to content

Commit 21a5c7c

Browse files
committed
io_tester: disambiguate sstring streaming to YAML::Emitter
Newer yaml-cpp (>= 0.8.0) adds an operator<<(Emitter&, const std::string_view&) overload alongside the existing const std::string& one. Since seastar::sstring is implicitly convertible to both std::string and std::string_view, streaming an sstring directly into a YAML::Emitter became ambiguous and broke the build (seen on the Alpine CI image): error: ambiguous overload for 'operator<<' (operand types are 'YAML::Emitter' and 'seastar::sstring') Explicitly convert to std::string at the two affected call sites. The std::string overload has always existed, so this remains correct on older yaml-cpp versions as well.
1 parent 0afc1d9 commit 21a5c7c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/io_tester/io_tester.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ class io_class_data : public class_data {
648648

649649
void emit_one_metrics(YAML::Emitter& out, sstring m_name, bool check_class_metrics = true) {
650650
if (auto v = get_one_metrics(m_name, check_class_metrics); v.has_value()) {
651-
out << YAML::Key << m_name << YAML::Value << *v;
651+
out << YAML::Key << std::string(m_name) << YAML::Value << *v;
652652
}
653653
}
654654

@@ -1206,7 +1206,7 @@ class context {
12061206
future<> emit_results(YAML::Emitter& out) {
12071207
return _finished.wait(_cl.size()).then([this, &out] {
12081208
for (auto& cl: _cl) {
1209-
out << YAML::Key << cl->name();
1209+
out << YAML::Key << std::string(cl->name());
12101210
out << YAML::BeginMap;
12111211
cl->emit_results(out);
12121212
out << YAML::EndMap;

0 commit comments

Comments
 (0)