Content deleted Content added
Line 73:
import std;
using String = std::string;
template <typename T>
using AlwaysFalse = std::always_false<T>;
template <typename T, T v>
using IntegralConstant = std::integral_constant<T, v>;
template <typename T>
using Vector = std::vector<T>;
consteval auto makeInvoker(Info& refl, const String& methodName) {
return [refl](auto&& instance) {
constexpr
for (
if (std::meta::identifier_of(member) == methodName) {
return [&]<auto M>(
instance.[:M: ]();
}(
}
}
static_assert(
};
}
Line 94 ⟶ 104:
// With reflection
constexpr auto reflFoo = ^^Foo;
auto invokePrint = makeInvoker(reflFoo, "printHello");
invokePrint(foo);
|