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

One way to avoid the extra code from constructors is to make them constexpr. This way the compiler can initialize it with 0 or a value and not generate all that extra code to execute a constructor at runtime.

I'm not sure how many people interested in this article is interested in C++ compile times but I once measured and wrote an article https://bolinlang.com/wheres-my-compile-time



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

Search: