Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't agree with that analogy. For example, templates were for sure complex, and they're very much a complete feature. That is, they haven't been made more complex over time. If we accept that the committee has already dug themselves into a hole, what they're doing is digging themselves out by digging out the entire field to the same depth, thus eliminating the hole originally dug, which I think it's a perfectly reasonable strategy.


> For example, templates were for sure complex, and they're very much a complete feature. That is, they haven't been made more complex over time.

I agree with your broader point but parameter packs (aka, variadic templates) were an addition to templates made in C++11. So strictly speaking they have gotten more complex.


Fair enough, but that addition wasn't to solve the problem of templates being too complex, but to support usages that were previously impossible.


They were possible and widely used, but a lot less ergonomic. You "just" had to copy-paste some number of instantiatons for the number of arguments between 0 and, say, 50.


Wasn't it also at the cost of compilation memory? I still remember the time when it was easy to crash compilers by just giving them hard enough templates.


I mean, that's just the tip of the iceberg. Templates have evolved a great deal over time, and continue to do so (C++20 added Concepts).


Constraints and concepts don't increase the scope or feature set of templates, which was GP's broader point. That is, all the additions are around things that are a smaller, but easier to use, subset of the broader feature. `if constexpr` for example just being a way more approachable std::enable_if, not an expansion of the feature set. And concepts then are about clarifying the contract of the template, they don't actually add new capabilities.

It'd be I think reflection, however that ends up looking, that's the next actual feature set expansion of templates.


They added a whole new keyword just to support it. Just because C++ templates are Turing complete doesn't mean new features don't count as new features.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: