r/cpp • • May 03 '26

The Most Confusing C++ Behavior

https://codestyleandtaste.com/most-confusing-C++-behavior.html
37 Upvotes

51 comments sorted by

View all comments

Show parent comment

-5

u/levodelellis May 04 '26

I actually do 5 in real code, but rest is because I intention to have all the code on a mobile screen. I really didn't think it'd annoy anyone

I like Allman brackets too but sometimes if its 5 or fewer lines I'll may keep the opening brace on the first line. I noticed the * before the new was a little weird but I didn't want to put a parenthesis because that looked noisier to me. Attaching it to new makes my eyes think it happens before the type expression. The line is just weird and I don't have a default for it

Most of these are just because I wanted it aligned and small enough for most mobile devices