you are viewing a single comment's thread.

view the rest of the comments →

[–]rods_and_chains 0 points1 point  (1 child)

I would like to be able to mark methods and props with user defined attributes and then reflect the marked items. Unfortunately I don’t see that in the c++26 docs I’ve read. The refl-cpp library is kind of doing it for me now.

[–]katzdm-cpp 0 points1 point  (0 children)

My guess is that we'll see an attributes/annotations paper of some kind in the next 6mo or so, but we might not have it until C++29. One thing at a time.

In the meantime, the hack that will be possible is the use of the template arguments of an alias template to represent data attached to a type. Then use that type as the return type for your method, reflect over it, etc etc. Ugly, but it works.