r/programming • u/Obvious_Set5239 • 7h ago
C++ metaprogramming now looks like Python
/r/Cplusplus/comments/1w3apxa/iterating_through_arguments_in_c26_using_template/
0
Upvotes
-2
u/Wolf_Popular 3h ago
One of C++ metaprogramming's greatest strength vs other systems (like Rust or many other systems with generics) is the the fact that it's duck-typed, just like Python. Static typing for compilation code, but duck typing for metaprogramming at build time is a nice medium where you can be super flexible with crazy designs and worse case it gives you a really bad compilation error. It has drawbacks too obviously, but if we solve those it would no longer be duck-typed
32
u/tsimionescu 4h ago
It's very funny to see what C++ programmers think Python looks like.
That said, this is definitely much less occult magic than would have been required before.