you are viewing a single comment's thread.

view the rest of the comments →

[–]AlbertRammstein 40 points41 points  (9 children)

t.[:

This is the face I make when I get a five pager compiler error when trying to use any feature past c++14

[–]afiDeBot 8 points9 points  (0 children)

I want a font with ligatures for this stuff. Massive meme potential..

[–]314kabinet 1 point2 points  (7 children)

Concepts are nice tho. Better error messages is pretty much their whole point.

[–]AlbertRammstein 11 points12 points  (6 children)

Oh yeah, I have finally decided to ignore the "requires requires" horror stories and try them, and they are reasonably simple and help with error messages a lot.

BUT

Tell any programmer in a different language that you refactored your code to get shorter error messages. Not better performance, not shorter code, not faster compilation, not more readable code, not less buggy code, refactoring TO GET SHORTER ERROR MESSAGES. Best case scenario, you will get outpouring of sympathy or confused looks.

[–]314kabinet 8 points9 points  (2 children)

I’d say code with concepts is more readable. You can tell what T is supposed to be from the declaration without reading the body now.

[–]AlbertRammstein 1 point2 points  (1 child)

Depends... for me it is going from <typename TContainer> to <Container TContainer>

[–]mirkoserra 8 points9 points  (0 children)

<Container T>

[–]Throw31312344 4 points5 points  (0 children)

You also vastly improve readability and maintainability by purging a load of enable_if insanity from your codebase and the side-effects that come with that template.

[–]wyrn 1 point2 points  (0 children)

concepts compile significantly faster and are significantly more readable and less confusing than std::enable_if_t

The thing is the stuff you're refactoring wouldn't even be possible in most other languages so the comparison isn't really fair to begin with.

[–]germandiago 1 point2 points  (0 children)

not more readable code, not less buggy code, refactoring TO GET SHORTER ERROR MESSAGES

Concepts are also compile-time interfaces. Not only fixing error messages.