Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Apr 15, 2024
1 parent 28cf2f1 commit 37614ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion iguana/reflection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ template <typename T, size_t Size>
struct member_helper {
template <typename Tuple, size_t... I>
auto operator()(Tuple &&tp, uint32_t sub_val, std::index_sequence<I...>) {
std::unordered_map<uint32_t, T> map;
std::map<uint32_t, T> map;
((map[std::get<I>(tp).field_no - sub_val] =
T{std::in_place_index<I>, std::move(std::get<I>(tp))}),
...);
Expand Down
4 changes: 2 additions & 2 deletions iguana/struct_pb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ inline void from_pb(T& t, std::string_view pb_str) {

template <typename T>
inline void to_pb(T& t, std::string& out) {
const auto& arr = get_members(t);
for (auto& [field_no, member] : arr) {
const auto& map = get_members(t);
for (auto& [field_no, member] : map) {
std::visit(
[&t, &out](auto& val) {
using value_type = typename std::decay_t<decltype(val)>::value_type;
Expand Down

0 comments on commit 37614ef

Please sign in to comment.