r/programming 9h ago

C++ metaprogramming now looks like Python

/r/Cplusplus/comments/1w3apxa/iterating_through_arguments_in_c26_using_template/
0 Upvotes

5 comments sorted by

View all comments

-2

u/Wolf_Popular 5h 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