October 2020

Checking a Header-Only C++ Library Collection (awesome-hpp)

Somehow, we've happened to check most of the libraries making up a collection called "Awesome hpp". These are small header-only projects in C++. Hopefully, the information about the bugs we've found will help make the libraries better.

Checking a Header-Only C++ Library Collection (awesome-hpp)

by Andrey Karpov

From the article:

A note for library developers. You can use PVS-Studio to check open-source projects for free. To get a free license to use with your open-source project, please fill in this form.

17 Smaller but Handy C++17 Features--Bartlomiej Filipek

Did you know about them?

17 Smaller but Handy C++17 Features

by Bartlomiej Filipek

From the article:

When you see an article about new C++ features, most of the time you’ll have a description of major elements. Looking at C++17, there are a lot of posts (including articles from this blog) about structured bindings, filesystem, parallel algorithms, if constexpr, std::optional, std::variant… and other prominent C++17 additions.

But how about some smaller parts? Library or language improvements that didn’t require decades to standardise or violent “battles” at the ISO meetings.

In this article, I’ll show you 17 (plus a few extra!) smaller C++17 things that will improve your code...

More and More Utilities in C++20--Rainer Grimm

Small but usefull things.

More and More Utilities in C++20

by Rainer Grimm

From the article:

Today, I present a few utilities for calculating the midpoint of two values, check if a std::string starts or ends with a substring, and create callables with std::bind_front. These little utilities may not seem so little when you need them...

Lay a strong foundation by writing secure C and C++ utilities

*nix systems assume you know what you're doing - even if you're doing something silly or dangerous. That's why you need to take extra precautions if you expect your code to be run as a privileged process.

Lay a strong foundation by writing secure C and C++ utilities

by G. Ann Campbell

From the article:

Libraries and system utilities form the foundations on which larger projects are built. So it's critical to make sure they, in particular, are secure. That's why we recently introduced five new rules for C++ and C to detect broken authentication and access control in *nix systems. The new rules fall into three categories: account validity, granting permissions, and changing directories.

SonarLint for Visual Studio adds secondary locations

The latest release of SonarLint for Visual Studio adds secondary locations to help you better understand the issues it raises in your C++ code. SonarLint is a free static analysis extension installable from the Visual Studio Marketplace. 

Visualizing issues with secondary locations

By Duncan Pocklington

From the article: 

All SonarLint issues specify a location in the code showing where the issue occurs. However, some of the more complex rules produce issues for which a single location is not enough to adequately explain why the issue has occurred. These more complex rules often identify additional locations in the code to help understand the problem. These additional locations are referred to as secondary locations.

2020-10 mailing available

The 2020-10 mailing of new standards papers is now available.


WG21 Number Title Author Document Date Mailing Date Previous Version Subgroup
N4863 Agenda for Fall Virtual WG21/PL22.16 Meeting John Spicer 2020-10-02 2020-10   All of WG21
N4864 WG21 virtual meeting: Autumn 2020 Herb Sutter 2020-09-21 2020-10   All of WG21
N4865 Response to Editorial Comments: ISO/IEC DIS 14882, Programming Language C++ Barry Hedquist 2020-10-19 2020-10   All of WG21
N4866 WG21 admin telecon meeting: Pre-Autumn 2020 Herb Sutter 2020-10-14 2020-10   All of WG21
N4867 Editors' Report -- Programming Languages -- C++ Richard Smith 2020-10-18 2020-10   All of WG21
N4868 Working Draft, Standard for Programming Language C++ Richard Smith 2020-10-18 2020-10   All of WG21
P0847R5 Deducing this Barry Revzin 2020-10-16 2020-10 P0847R4 EWG Evolution
P0849R4 auto(x): decay-copy in the language Zhihao Yuan 2020-10-11 2020-10 P0849R3 EWG Evolution,LWG Library
P0870R4 A proposal for a type trait to detect narrowing conversions Giuseppe D'Angelo 2020-09-23 2020-10 P0870R3 SG6 Numerics
P1048R1 A proposal for a type trait to detect scoped enumerations Juan Alday 2020-10-16 2020-10 P1048R0 LWG Library
P1206R2 ranges::to: A function to convert any range to a container Corentin Jabot 2020-10-12 2020-10 P1206R1 LEWG Library Evolution
P1401R4 Narrowing contextual conversions to bool Andrzej Krzemieński 2020-10-08 2020-10 P1401R3 EWG Evolution
P1525R1 One-Way execute is a Poor Basis Operation Eric Niebler 2020-10-14 2020-10 P1525R0 LEWG Library Evolution
P1759R3 Native handles and file streams Elias Kosunen 2020-10-12 2020-10 P1759R2 LEWG Library Evolution
P1938R2 if consteval Barry Revzin 2020-10-13 2020-10 P1938R1 EWG Evolution
P2029R4 Proposed resolution for core issues 411, 1656, and 2333; escapes in character and string literals Tom Honermann 2020-10-19 2020-10 P2029R3 CWG Core
P2066R4 Suggested draft TS for C++ Extensions for Minimal Transactional Memory Jens Maurer 2020-10-14 2020-10 P2066R3 SG1 Concurrency and Parallelism,EWG Evolution,LEWG Library Evolution
P2093R2 Formatted output Victor Zverovich 2020-10-15 2020-10 P2093R1 LEWG Library Evolution
P2148R0 Library Evolution Design Guidelines CJ Johnson 2020-09-23 2020-10   LEWGI SG18: LEWG Incubator,LEWG Library Evolution
P2171R1 Rebasing the Networking TS on C++20 (revision 1) Jonathan Wakely 2020-10-15 2020-10 P2171R0 LWG Library
P2171R2 Rebasing the Networking TS on C++20 (revision 2) Jonathan Wakely 2020-10-18 2020-10 P2171R1 LWG Library
P2187R5 std::swap_if, std::predictable Nathan Myers 2020-10-19 2020-10 P2187R4 LEWG Library Evolution
P2192R3 std::valstat - Returns Handling Dusan B. Jovanovic 2020-10-13 2020-10 P2192R2 LEWGI SG18: LEWG Incubator
P2198R1 Freestanding Feature-Test Macros and Implementation-Defined Extensions Ben Craig 2020-10-04 2020-10 P2198R0 SG10 Feature Test
P2214R0 A Plan for C++23 Ranges Barry Revzin 2020-10-14 2020-10   LEWG Library Evolution
P2223R1 Trimming whitespaces before line splicing Corentin Jabot 2020-10-17 2020-10 P2223R0 EWG Evolution,CWG Core
P2226R0 A function template to move from an object and reset it to its default constructed state Giuseppe D'Angelo 2020-10-18 2020-10   SG1 Concurrency and Parallelism,LEWGI SG18: LEWG Incubator,SG20 Education
P2227R0 Update normative reference to POSIX Jonathan Wakely 2020-10-02 2020-10   LWG Library
P2228R0 Slide Deck for P1949 EWG Presentation 20200924 Steve Downey 2020-10-15 2020-10   EWG Evolution
P2231R0 Add further constexpr support for optional/variant Barry Revzin 2020-10-13 2020-10   LEWG Library Evolution
P2233R0 2020 Fall Library Evolution Polls Bryce Adelstein Lelbach 2020-10-15 2020-10   LEWG Library Evolution
P2234R0 Consider a UB and IF-NDR Audit Scott Schurr 2020-10-14 2020-10   SG12 Undefined and Unspecified Behavior,EWGI SG17: EWG Incubator
P2235R0 Disentangling schedulers and executors Ville Voutilainen 2020-10-15 2020-10   SG1 Concurrency and Parallelism,LEWG Library Evolution
P2236R0 C++ Standard Library Issues to be moved in Virtual Plenary, Nov. 2020 Jonathan Wakely 2020-10-15 2020-10   All of WG21
P2237R0 Metaprogramming Andrew Sutton 2020-10-15 2020-10   SG7 Reflection

The current Berlin status for Meeting C++ 2020

An update on how Meeting C++ 2020 will be online but also feature a small onsite event in Berlin:

The current Berlin status for Meeting C++ 2020

by Jens Weller

From the article:

With this post I'd like to give you the details for the onsite event in Berlin in November 2020.

First, let me say that unless there is a local lockdown, this is going to happen. I've been in Berlin at the beginning of the week, and had a meeting with the hotel. So this is the up to date information. And I assume for some of you its something to look forward to, to enjoy a real conference with actual people in 2020. The tickets for Berlin are available, and these include access to the online event.

Part 2: Upsetting Opinions about Static Analyzers

By writing the article "Upsetting Opinions about Static Analyzers" we were supposed to get it off our chest and peacefully let it all go. However, the article unexpectedly triggered robust feedback. Unfortunately, the discussion went in the wrong direction, and now we will make a second attempt to explain our view of this situation.

Part 2: Upsetting Opinions about Static Analyzers

by Andrey karpov

From the article:

And started coming up with cases when it might be justified, which means that the PVS-Studio analyzer warning was a false-positive. Some speculations about the change in memory between two checks came into play which occurs due to:

  • running parallel threads;
  • signal/interrupt handlers;
  • the variable X is a reference to the element A[0];
  • hardware, such as performing DMA operations;
  • and so on.

After heated debate on the analyzer's inability to comprehend all cases, they left to cut down forest with axes. In other words, they found an excuse why they could still avoid using a static code analyzer in their work.