Question Details

No question body available.

Tags

c++ lambda reflection metaprogramming c++26

Answers (1)

Accepted Answer Available
Accepted Answer
March 21, 2026 Score: 5 Rep: 20,554 Quality: High Completeness: 70%

This behavior is currently implementation-defined.

Per [meta.reflection.member.queries], nonstaticdatamembers_of(r, ctx) (where r is the reflection of a class or namespace Q) returns reflections of members M that are Q-members-of-representable. For a member to be Q-members-of-representable, that member must have a Q-members-of-eligible declaration.

Q-members-of-eligible requires, among others, that:

if Q is a closure type, then M is a function call operator or function call operator template.

It is implementation-defined whether declarations of other members of a closure type Q are Q-members-of-eligible.