4 ms·
Template metaprogramming is the ability to e.g. say int x = factorial<5>::value; and have 'x' initialized to "120" (i.e. execute computation at compile time,
by virgilp 9y ago
Template metaprogramming is the ability to e.g. say
int x = factorial<5>::value;
and have 'x' initialized to "120" (i.e. execute computation at compile time, not just define new types). Can you do anything like that in Rust? I only read a few about Rust, but my feeling was that it has powerful generics, but NOT template metaprogramming.
- steveklabnik 9y agoWe just accepted an RFC for this. So not today's Rust, but tomorrow's.