You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There might be a regression in the last refl-cpp release: refl::util::detail::filter(..) seems to invert the member order which has a notable impact on the find_first() method.
#include <iostream>
#include <https://raw.githubusercontent.com/veselink1/refl-cpp/master/include/refl.hpp>
struct Point {
float x;
float y;
float z;
};
REFL_TYPE(Point)
REFL_FIELD(x)
REFL_FIELD(y)
REFL_FIELD(z)
REFL_END
constexpr auto members = refl::reflect<Point>().members;
constexpr auto condition = [](auto member) { return true; };
static_assert(find_first(members, condition).name == "x"); // <- fails but should be correct
// static_assert(find_first(members, condition).name == "z"); // works
See compiler-explorer for further details and a live demo of this feature.
The text was updated successfully, but these errors were encountered:
RalphSteinhagen
changed the title
refl::util::detail::filter(..) inverts order of member
refl::util::detail::filter(..) inverts order of member list
Jan 7, 2022
There might be a regression in the last refl-cpp release:
refl::util::detail::filter(..)
seems to invert the member order which has a notable impact on thefind_first()
method.See compiler-explorer for further details and a live demo of this feature.
The text was updated successfully, but these errors were encountered: