Wednesday, September 9, 2020

New safety rules in C++ Core Check 

While the for loop part may be a bit spotty, in the sense you should be paying attention and know which you want when writing the statement. I have to admit I would have liked the auto thing.

I’ve mainly relied on C++14 since about 2016 for my C++ use whenever possible, and sometimes newer because of standard library. While catching up wasn’t as painful as I thought, aside from how long it’s taken for C++17 to trickle through various Linux distributions, there were a few things I found myself watching closer.

One of these was the way auto typing copes with references. I learned pretty quickly to watch my syntax  when using auto. If a real warning was available: it would have been much faster to notice the distinction. In my code, you’ll usually see auto used when the type would be redundant salt. But we usually want our sugars to not to have unintended pains, lol.

The code samples on the switch/case part also makes me remember just how verbose C’s simple switch/case statements are by today’s standards. Damn it, now my kind is flashing to SML....lol

No comments:

Post a Comment