C++ : if constexpr isn't broken
brevzin.github.io
C++ : if constexpr isn't broken
1–10 of 83 posts
Re: C++ : if constexpr isn't broken
#2Re: C++ : if constexpr isn't broken
#3Re: C++ : if constexpr isn't broken
#4Re: C++ : if constexpr isn't broken
#5Overuse of if statements is generally something of a code smell and tends to make code harder to follow. To my taste the C++ way of doing things is generally preferable as a result even if more verbose. Given this is probably somewhat a matter of taste it is hard to justify changing C++ to match the D way IMO.
Re: C++ : if constexpr isn't broken
#6I think I just got used to C++11. What is this dark magic?
Re: C++ : if constexpr isn't broken
#7Re: C++ : if constexpr isn't broken
#8"a somewhat more awkward and uglier, yet slightly more correct way... all the functionality is right there. We’re not missing anything" might as well be C++'s motto :)
Arguably, lol.
Re: C++ : if constexpr isn't broken
#9Re: C++ : if constexpr isn't broken
#10Why is it every time I see a new article about C++ features my eyes glaze over? Am I just getting old, or has C++ jumped the shark?
A lot of these features seem like ways to hack around the fact that C++ templates are not generics, they are literally templates for writing copies of classes. It seems like features like this are going to make code size explode.
A lot of the examples also seem very smelly from an OOP perspective. We should one class be able to have different fields depending on template parameters? That seems like something one should do in a subclass.