Conversation
While it's certainly nice that C++ allows you to not have {} to
encapsulate a function body if that body only consists of a single
statement (here: `try{…}`), it is not of any familiarity to C++ coders
to omit them.
Same goes for putting `main`'s argc/argv arguments on multiple lines.
Also, defining a macro PRIVATE_SOMETHING just to use it once one line of
code below is a bit of a strange thing to do.
So, I got rid of the macro and applied the clang-format style from
https://github.com/boost-experimental/vc
4e56947 to
1258d42
Compare
|
I felt if everything was going to be And teaching the novices about function-whole |
|
I beg to differ. This is an example meant to be easy to understand; it's not meant to teach C++ syntax that people seldom come across. (I'd give my opinion about the quality of the idea of doing single statement body blocks without brackets, but I already did so.) |
|
Also, boost at least strives to have a common and (compared to omission of brackets in function bodies) sane style; that's why the aforementioned style file exists. I don't think individual examples should choose to diverge from that. |
While it's certainly nice that C++ allows you to not have {} to
encapsulate a function body if that body only consists of a single
statement (here:
try{…}), it is not of any familiarity to C++ codersto omit them.
Same goes for putting
main's argc/argv arguments on multiple lines.Also, defining a macro PRIVATE_SOMETHING just to use it once one line of
code below is a bit of a strange thing to do.
So, I got rid of the macro and applied the clang-format style from
https://github.com/boost-experimental/vc