r/cpp • • Apr 19 '20

Default function arguments are the devil

https://quuxplusone.github.io/blog/2020/04/18/default-function-arguments-are-the-devil/
90 Upvotes

149 comments sorted by

View all comments

Show parent comment

13

u/[deleted] Apr 19 '20

I think goto may have a valid use as a way to break out of nested loops when you need to break to a specific loop -- refactoring may or may not work with something like this.

I haven't seen this too much in real life (outside of very rare uses in Java where it's part of the lang) but I have heard that brought up as a valid case.

1

u/uninformed_ Apr 19 '20

This can also be achieved with a lambda/ function and return statement.