diff --git a/tools/reflect/src/SvEnum.cpp b/tools/reflect/src/SvEnum.cpp index 85b4ce300..1191bea72 100644 --- a/tools/reflect/src/SvEnum.cpp +++ b/tools/reflect/src/SvEnum.cpp @@ -4,7 +4,6 @@ #include "SvEnum.h" #include -#include void SvEnum::toCpp(HppFile& hppFile, std::string_view, const SvAliases&, bool) const { auto underlyingType = [&] { @@ -77,7 +76,7 @@ void SvEnum::toCpp(HppFile& hppFile, std::string_view, const SvAliases&, bool) c hppFile.increaseIndent(); hppFile.addWithIndent("switch (__data.type) {\n"); hppFile.increaseIndent(); - for (const auto& [name, value] : members) + for (const auto& name : members | std::views::keys) hppFile.addWithIndent(fmt::format("case Type::{0}: os << \"{0}\"; break;\n", name)); hppFile.decreaseIndent(); hppFile.addWithIndent("}\n"); diff --git a/tools/reflect/src/SvStruct.cpp b/tools/reflect/src/SvStruct.cpp index 3aaa866c7..cb63647ba 100644 --- a/tools/reflect/src/SvStruct.cpp +++ b/tools/reflect/src/SvStruct.cpp @@ -176,7 +176,7 @@ void SvStruct::toCpp(HppFile& hppFile, const std::string_view _namespace, const hppFile.addWithIndent(fmt::format("operator {}() const {{\n", cppTypeStr)); hppFile.increaseIndent(); hppFile.addWithIndent(fmt::format("{} ret = 0;\n", cppTypeStr)); - for (const auto& [name, _] : members) { + for (const auto& name : members | std::views::keys) { hppFile.addWithIndent( fmt::format("ret |= static_cast<{0}>({1}) << {1}_s;\n", cppTypeStr, name)); } diff --git a/tools/reflect/src/SvUnion.cpp b/tools/reflect/src/SvUnion.cpp index 83590cf52..51743bc77 100644 --- a/tools/reflect/src/SvUnion.cpp +++ b/tools/reflect/src/SvUnion.cpp @@ -36,7 +36,7 @@ void SvUnion::toCpp(HppFile& hppFile, std::string_view _namespace, const SvAlias // Create a sc bit vector to store the data of the Union hppFile.addWithIndent(fmt::format("{} union_data;\n\n", cppTypeStr)); - // Check if some headers needs to be included + // Check if some headers need to be included for (const auto& member : type.getCanonicalType().as().members()) { const auto& variable = member.as();