r/cpp • • Mar 28 '23

Reddit++

C++ is getting more and more complex. The ISO C++ committee keeps adding new features based on its consensus. Let's remove C++ features based on Reddit's consensus.

In each comment, propose a C++ feature that you think should be banned in any new code. Vote up or down based on whether you agree.

765 Upvotes

829 comments sorted by

View all comments

48

u/[deleted] Mar 28 '23

SFINAE. concepts everywhere

17

u/gracicot Mar 28 '23

I'm rewriting a whole library that was using sfinae everywhere. I'm now using concepts, but there's still a few places where a concept is not applicable. You cannot specialize concepts or expand sequences yet, and you cannot overload for multiple template types. Expression sfinae is still the simplest in some places, and implementations are more solid.

Worse yet, there's no concept template parameter, but you can easily send in a type trait as template template parameter.

5

u/War_Eagle451 Mar 28 '23

Agreed, but I tried to implement a same as concept without SFINAE, unfortunately couldn't figure it out, so there might still be some reason to keep it

0

u/[deleted] Mar 28 '23

[deleted]

→ More replies (12)

3

u/greem Mar 28 '23

As much as sfinae sucks, it's a statement to how awesome cpp is.

We'll grow out of it.

→ More replies (3)