RE: [C++] 11-23-2015, 07:25 PM
#4
(11-23-2015, 06:49 PM)m0dem Wrote: I'm pretty sure for one-liner `if` statements in C/C++, it is optional to use the brackets {}, correct me if I'm wrong
I prefer using the brackets anyways tho (for readability), but that's just my opinion.
I know some languages don't require it for one line statements. As I said I am not all that familiar with C++, just other C-style languages.
But yes - I always use them simply for consistency. And if they are ever updated or something added to the block, I don't need to reformat later. In fact I don't know of many people who do actually use this "feature" when they code.

![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)