News for hackers. Stuff that matters.

BudVVeezer

The title is incorrect, it's WG23, not WG32.
> __they don't want these things next to where they live__.

Which is the precise definition of Not In My Back Yard...

Re:C++17 is formally approved on Thursday September 07, 2017 @08:24AM (#15191156)
It's consistent with for (init; condition;) {} and solves a problem like:

if (std::vector<int> v = f(); !v.empty()) { // Use v }

without requiring an extra compound statement to limit the scope and lifetime of v.

Not quite.

It was submitted for PDTS (proposed draft technical standard), which means it goes out for balloting to ISO national bodies. That balloting either succeeds (at which point you have a Techincal Specification) or it comes back to the committee with comments that the committee then has to respond to (and then another round of balloting happens). Once it's accepted as a Technical Specification, it's still not part of the C++ International Standard. That's a decision the committee comes to at their own pace, much like what happened at this meeting where the Concepts TS was accepted (as amended) into the IS.

Think of a TS somewhat like a beta. There's no assurance that the contents of the TS will go into the IS at all or in the exact form it was originally specified in, but that's certainly the hope when the TS is published.

The clang-tidy tool has some C++ Core Guideline checks under the cppcoreguidelines module.
Some of these rules are currently in clang-tidy, but the coverage is by no means comprehensive. Patches always welcome. :-)
What's considered critical or difficult to discover is a bit subjective, but:

It's easy to forget that alignment is important on some architectures (other than for performance reasons), so be careful when using placement new: https://www.securecoding.cert.org/confluence/display/cpluspl...

This may seem obvious, but even the C++ committee got this one wrong when they created auto_ptr (which has since been removed from the standard): https://www.securecoding.cert.org/confluence/display/cpluspl...

This one is totally obvious but has a stunning number of ways you can fail to adhere to it, some of which look reasonable at first blush: https://www.securecoding.cert.org/confluence/display/cpluspl...

Re:Notes on Programming in C – Rob Pike (1989) on Sunday March 12, 2017 @08:03PM (#13854100)
Yes and no. Many compilers support #pragma once, but whether your build environment handles it is another matter. Having your headers on network drives, or having symlinks to your headers, etc can cause issues with #pragma once handling (depending on the implementation) that can often be hard to track down, especially if building with multiple compilers. Include header guards do not have these issues.
Re:Delete an inline function, save 794 kB on Monday January 23, 2017 @01:44PM (#13464686)
Is it the /d1reportSingleClassLayoutXXX flag, described here?

https://blogs.msdn.microsoft.com/vcblog/2007/05/17/diagnosin...

Re:Under the hood of C++ lambdas and std::function on Monday March 28, 2016 @12:01PM (#11375032)
You are forgetting attributes, which can be empty and are grammatical sequences (so you can add them infinitely).

[[]][[]][]()[[]][[]]{}();

Re:C++ Status at the end of 2015 on Friday January 01, 2016 @01:50PM (#10822806)
Ah, that's right, ranges was a new work item planned for TS (but still not planned for IS in C++17).
Re:C++ Status at the end of 2015 on Thursday December 31, 2015 @11:51AM (#10818373)
The author may be a bit confused as to what C++17 will be. Modules will be in a TS, most likely. Transactional memory, concepts, ranges, and filesystem are already in published TSes (not planned for the IS in this round). Out of the list presented, only fold expressions and __has_include are actually already voted in for C++17 itself. The rest are in various stages of standardization (mostly TSes) and are not guaranteed to ever become part of the IS (though hopefully many will).
Re:Atria: A toolkit for modern C++ development from Ableton on Tuesday August 18, 2015 @08:35PM (#10083067)
Boost is a very large project with varying degrees of API quality, and so when you say it depends on boost, I wonder "the good parts (any, variant, stuff that usually gets looked at for standardization)" or "the bad parts (Spirit, etc)". Also, as others have said, it's a huge dependency that generally raise a red flag (for performance and compile time).
Re:Ask HN: Resources on secure coding in C? on Friday August 14, 2015 @09:56AM (#10060105)
I would highly recommend looking at the CERT C Coding Standards, which are available for free: https://www.securecoding.cert.org/confluence/display/c/SEI+C...

One thing to note, they split them into recommendations and rules. Recommendations are more stylistic and open to debate, whereas violations of rules generally result in definite security concerns.

Re:Strange C Syntax on Sunday August 02, 2015 @07:10PM (#9992876)

Older »