diff --git a/include/ylt/standalone/iguana/pb_util.hpp b/include/ylt/standalone/iguana/pb_util.hpp index 67162b625..d1bd3d03b 100644 --- a/include/ylt/standalone/iguana/pb_util.hpp +++ b/include/ylt/standalone/iguana/pb_util.hpp @@ -178,8 +178,8 @@ constexpr inline WireType get_wire_type() { } template -constexpr bool is_lenprefix_v = - (get_wire_type() == WireType::LengthDelimeted); +constexpr bool is_lenprefix_v = (get_wire_type() == + WireType::LengthDelimeted); [[nodiscard]] IGUANA_INLINE uint32_t encode_zigzag(int32_t v) { return (static_cast(v) << 1U) ^ diff --git a/include/ylt/standalone/iguana/reflection.hpp b/include/ylt/standalone/iguana/reflection.hpp index f250d8614..354d8a119 100644 --- a/include/ylt/standalone/iguana/reflection.hpp +++ b/include/ylt/standalone/iguana/reflection.hpp @@ -4,6 +4,7 @@ #ifndef IGUANA_REFLECTION_HPP #define IGUANA_REFLECTION_HPP +#include #include #include #include @@ -17,7 +18,6 @@ #include #include #include -#include #include "detail/string_stream.hpp" #include "detail/traits.hpp" diff --git a/src/struct_pb/examples/main.cpp b/src/struct_pb/examples/main.cpp index 124a0e7d7..e2b4d08ba 100644 --- a/src/struct_pb/examples/main.cpp +++ b/src/struct_pb/examples/main.cpp @@ -18,7 +18,7 @@ struct nest : struct_pb::base_impl { std::string name; my_struct value; int var; - std::variant mv; + std::variant mv; }; REFLECTION(nest, name, value, var, mv); @@ -53,7 +53,8 @@ int main() { // dynamic reflection auto t = struct_pb::create_instance("nest"); auto names = t->get_fields_name(); - bool r = (names == std::vector{"name", "value", "var", "mv"}); + bool r = + (names == std::vector{"name", "value", "var", "mv"}); assert(r); t->set_field_value("mv", std::variant{1}); @@ -61,16 +62,15 @@ int main() { auto const temp = std::variant{1}; assert(mv == temp); - t->set_field_value("name", std::string("tom")); auto name = t->get_field_value("name"); assert(name == "tom"); - auto d = dynamic_cast(t.get()); + auto d = dynamic_cast(t.get()); assert(d->name == "tom"); t->set_field_value("name", "hello"); - auto &field_name = t->get_field_value("name"); + auto& field_name = t->get_field_value("name"); assert(field_name == "hello"); // dynamic any @@ -80,7 +80,4 @@ int main() { auto const& mvar_any = t->get_field_any("mv"); auto const& mvar = std::any_cast>(mvar_any); assert(mvar == temp); - - - } \ No newline at end of file