I'm not an author of P1240, but...On Tue, Feb 1, 2022 at 12:24 AM Matus Chochlik via SG7 <sg7@lists.isocpp.org> wrote:ADL still works on std::meta::info, so is_named(^int) is valid by itself.
2) is it / will it be possible for the "filters" in members_of to be lambdas or other boolean-returning callables?I think that's the point, yeah. As opposed to?
3) I have found that there are many use-cases (implementing RPC boilerplate, implementing SQL generator, implementing the factory pattern, and more) where there is a set of functions like foo, bar, baz that are calling each other, which operate on `reflections` (of base-level "things" that are not reified on the base level, like a constructor, a namespace, an expression) that are passed from outside to the algorithm, andsplicing is done in the innermost function.pseudocode:auto baz(metaobject auto mo) {return do_something([: mo :]);}auto bar(metaobject auto mo, auto arg1, auto arg2) {return baz(transform1(transform2(mo, arg2), arg1);}auto foo(metaobject auto mo, auto arg1, auto arg2. auto arg3) {return bar(transform3(mo, arg3));}cout << foo(^std, 1, '2', "3");Is it correct that the only way to do this with meta info is to pass the metaobject in template arguments?Can you provide a more real example?
template <std::meta::info mo> auto baz() {
return do_something([: mo :]);
}
template <std::meta::info mo> auto bar(auto arg1, auto arg2) {return bar<transform1<transform2<mo>(arg2)>(arg1)>();}template <std::meta::info mo> auto foo(auto arg1, auto arg2, auto arg3) {return bar<transform3<mo>(arg3)>(arg1, arg2);}cout << baz<^std>(1, '2', "3")I suppose the real question is: Does this work?consteval auto f(std::meta::info type) {return sizeof([:type:]);}And the answer is no: in the paper, [: refl:] is only valid if refl is a constant expression. Which, until we get constexpr function parameters, means it must be passed as a template parameter.