r/programming • • Sep 02 '26

CTTI is Exponential, RTTI is Linear

https://www.gingerbill.org/article/2026/09/02/ctti-is-exponential-rtti-is-linear/
96 Upvotes

90 comments sorted by

View all comments

Show parent comment

2

u/jonesmz Sep 03 '26

Didn't C++26 add a global reflection apparatus?

I suppose that's not completely ratified yet, but i do think it's finalized.

2

u/QuaternionsRoll Sep 03 '26

Yes, C++26 added comptime reflection, but isn’t global, which prevents it from being used to do the kind of stuff OP is talking about. You can’t define a reflection procedure and apply it to every accessible type in the program, for example.

To be clear, global comptime reflection would be more-or-less untenable: you’d have to either abandon support for dynamically-linked or otherwise source-unavailable-at-comptime libraries, or accept that this ostensibly “global” reflection would be incomplete and/or unreliable.

1

u/jonesmz Sep 03 '26

Ah. Excellent explanation, thanks!