3 ms·
I fear the havoc widespread use of constexpr meta-programming could wreak on compile speed. A few such declarations have no noticeable impact on compile times,
by timmytokyo 11y ago
I fear the havoc widespread use of constexpr meta-programming could wreak on compile speed. A few such declarations have no noticeable impact on compile times, but as the project grows and such declarations start to proliferate, you can easily imagine productivity suffering due to slow compiles.
In my opinion, techniques like these fall under the category of "interesting but probably best avoided in production". Kind of like ray-tracers written with template meta-programming.
- daemin 11y agoI don't think it will be as bad as the slowdown caused by template metaprogramming, and according to some compiler vendors that has somewhat been taken care of already.
- Someone 11y agoIf that becomes a problem, I think it is fairly easy (certainly easier than with template metaprogramming) to move the constexpr code into a separate compilation unit, and let your make handle that problem.