From 843e4def02fa8a4295328129d2c2347320a4e90a Mon Sep 17 00:00:00 2001 From: Marcus Calhoun-Lopez Date: Tue, 30 May 2023 11:23:50 -0700 Subject: [PATCH] Fix write of std::vector::reference In `for (const auto &i: std::vector) {`, `i` is proxy for bool and not a bool. See https://en.cppreference.com/w/cpp/container/vector_bool/reference --- source/dynv/Xml.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dynv/Xml.cpp b/source/dynv/Xml.cpp index b822910..41a09f6 100644 --- a/source/dynv/Xml.cpp +++ b/source/dynv/Xml.cpp @@ -113,7 +113,7 @@ struct SerializeVisitor { if (!writeStart(stream, "li"s, true)) return false; ++indentation; - if (!types::xml::write(stream, i, indentation)) + if (!types::xml::write(stream, T(i), indentation)) return false; --indentation; if (!writeIndentation(stream, indentation)) @@ -123,7 +123,7 @@ struct SerializeVisitor { } else { if (!writeStart(stream, "li"s)) return false; - if (!types::xml::write(stream, i)) + if (!types::xml::write(stream, T(i))) return false; if (!writeEnd(stream, "li"s)) return false;