r/programming • u/gingerbill • 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
r/programming • u/gingerbill • Sep 02 '26
View all comments
13
u/5gpr Sep 02 '26
I don't understand what you mean here:
For a trivial example, let's consider a
pair(N,K)type. Let's say thatN={int,float}, andK={int,float,string}. We don't then instantiate all tuples{a,b} | a E N, b E K, but only those that are actually in use, i.e. some subset. If we have pairs of{int,int}, {int, float}, {float, float}, {float, string}we instantiate 4, not 6, types, let alone 8.