News

2021-09 Mailing Available

The 2021-09 mailing of new standards papers is now available.

 

WG21 Number Title Author Document Date Mailing Date Previous Version Subgroup
P0288R7 move_only_function (was any_invocable) Matt Calabrese, Ryan McDougall 2021-08-27 2021-09 P0288R6 LWG Library
P0447R16 Introduction of std::hive to the standard library Matt Bentley 2021-09-08 2021-09 P0447R15 SG14 Low Latency,LEWG Library Evolution,All of WG21
P0627R5 Function to mark unreachable code Jens Maurer 2021-09-19 2021-09 P0627R3 LWG Library
P0849R8 auto(x): decay-copy in the language Zhihao Yuan 2021-08-26 2021-09 P0849R7 CWG Core,LWG Library
P1018R13 C++ Language Evolution status pandemic edition 2021/06–2021/08 JF Bastien 2021-09-06 2021-09 P1018R12 EWG Evolution,All of WG21
P1072R10 basic_string::resize_and_overwrite Chris Kennelly 2021-09-14 2021-09 P1072R9 LWG Library
P1885R7 Naming Text Encodings to Demystify Them Corentin Jabot 2021-09-14 2021-09 P1885R6 LEWG Library Evolution
P2012R1 Fix the range-based for loop, Rev1 Nicolai Josuttis 2021-09-16 2021-09 P2012R0 EWG Evolution,CWG Core
P2036R3 Changing scope for lambda trailing-return-type Barry Revzin 2021-09-14 2021-09 P2036R2 CWG Core
P2066R9 Suggested draft TS for C++ Extensions for Minimal Transactional Memory Jens Maurer 2021-09-15 2021-09 P2066R8 CWG Core,LWG Library
P2093R9 Formatted output Victor Zverovich 2021-09-09 2021-09 P2093R8 LEWG Library Evolution
P2128R6 Multidimensional subscript operator Corentin Jabot 2021-09-14 2021-09 P2128R5 CWG Core
P2214R1 A Plan for C++23 Ranges Barry Revzin 2021-09-14 2021-09 P2214R0 LEWG Library Evolution
P2266R2 Simpler implicit move Arthur O'Dwyer 2021-08-31 2021-09 P2266R1 EWG Evolution,CWG Core
P2276R1 Fix cbegin Nicolai Josuttis 2021-09-10 2021-09 P2276R0 LEWG Library Evolution,LWG Library
P2278R1 cbegin should always return a constant iterator Barry Revzin 2021-09-15 2021-09 P2278R0 LEWG Library Evolution
P2314R3 Character sets and encodings Jens Maurer 2021-09-15 2021-09 P2314R2 CWG Core,LWG Library
P2316R2 Consistent character literal encoding Corentin Jabot 2021-09-14 2021-09 P2316R1 SG22 Compatability,CWG Core
P2322R4 ranges::fold Barry Revzin 2021-09-12 2021-09 P2322R3 LEWG Library Evolution
P2348R1 Whitespaces Wording Revamp Corentin Jabot 2021-09-15 2021-09 P2348R0 SG16 Unicode
P2362R3 Remove non-encodable wide character literals and multicharacter wide character literals Peter Brett 2021-08-27 2021-09 P2362R2 SG22 Compatability,CWG Core
P2363R1 Extending associative containers with the remaining heterogeneous overloads Konstantin Boyarinov 2021-09-15 2021-09 P2363R0 LEWG Library Evolution
P2372R3 Fixing locale handling in chrono formatters Victor Zverovich 2021-09-12 2021-09 P2372R2 LWG Library
P2388R1 Abort-only contract support Andrzej Krzemieński 2021-09-14 2021-09 P2388R0 SG21 Contracts
P2388R2 Minimum Contract Support: either Ignore or Check_and_abort Andrzej Krzemieński 2021-09-19 2021-09 P2388R1 SG21 Contracts
P2390R1 Add annotations for unreachable control flow Jens Gustedt 2021-09-17 2021-09 P2390R0 SG22 Compatability
P2408R1 Ranges views as inputs to non-Ranges algorithms David Olsen 2021-08-31 2021-09 P2408R0 LEWG Library Evolution
P2418R1 Add support for std::generator-like types to std::format Victor Zverovich 2021-09-12 2021-09 P2418R0 LWG Library
P2419R1 Clarify handling of encodings in localized formatting of chrono types Victor Zverovich 2021-09-19 2021-09 P2419R0 LEWG Library Evolution
P2430R0 Slides: Partial success scenarios with P2300 Christopher Kohlhoff 2021-08-23 2021-09   LEWG Library Evolution
P2431R0 Presentation: Plans for P2300 Revision 2 Michael Garland 2021-08-25 2021-09   SG1 Concurrency and Parallelism,LEWG Library Evolution
P2432R0 Fixing istream_view Nicolai Josuttis 2021-08-27 2021-09   SG9 Ranges,LEWG Library Evolution,LWG Library
P2435R0 2021 Summer Library Evolution Poll Outcomes Bryce Adelstein Lelbach 2021-09-09 2021-09   LEWG Library Evolution
P2436R0 2021 September Library Evolution Polls Bryce Adelstein Lelbach 2021-09-14 2021-09   LEWG Library Evolution
P2437R0 Support for #warning Aaron Ballman 2021-09-09 2021-09   EWG Evolution
P2438R0 std::string::substr() && Federico Kircheis 2021-09-14 2021-09   LEWGI SG18: LEWG Incubator,LEWG Library Evolution
P2439R0 Slides for P2415R1, what is a view? Tim Song 2021-09-10 2021-09   LEWG Library Evolution
P2440R0 ranges::iota, ranges::shift_left, and ranges::shift_right Tim Song 2021-09-12 2021-09   LEWG Library Evolution
P2441R0 views::join_with Barry Revzin 2021-09-14 2021-09   LEWG Library Evolution
P2442R0 Windowing range adaptors: views::chunk and views::slide Tim Song 2021-09-14 2021-09   LEWG Library Evolution
P2443R0 views::chunk_by Tim Song 2021-09-14 2021-09   LEWG Library Evolution
P2444R0 The Asio asynchronous model Christopher Kohlhoff 2021-09-15 2021-09   LEWG Library Evolution
P2446R0 views::move Barry Revzin 2021-09-17 2021-09   LEWG Library Evolution

CppCon 2020 Constructing Generic Algorithms: Principles and Practice--Ben Deane

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

Constructing Generic Algorithms: Principles and Practice

by Ben Deane

Summary of the talk:

"You have all these algorithms at your disposal. *Learn them.*"
-- Sean Parent, GoingNative 2013.

Great advice, and the algorithms can do a lot. But they can't do everything, and the fixed set in the standard was never meant to be the last word in every problem. Sometimes we do need to write our own solutions. What are the best practices for that?

This talk examines how to build our own algorithms. We'll start with a raw loop that solves a nontrivial problem, and turn it into a generic algorithm capable of supporting a wide variety of use cases without loss of expressivity or efficiency.

Along the way we'll consider algorithmic patterns, how to structure the
interface, how the types interact, iterator category concerns, testing, and
more. We'll look at how ranges and concepts help us to refine and focus things.

We'll also see where the existing algorithms fall short, and take a look at some non-obvious use cases, including some minor modifications or wrappings that give us extra flexibility.

C++20 Coroutines — Complete* Guide--Šimon Tóth

Learn to use them.

C++20 Coroutines — Complete* Guide

by Šimon Tóth

From the article:

C++20 brought us initial support for coroutines. In this article, we will go over several examples of coroutines that build upon each other. Word of warning, though, the support in C++20 is mainly targeted at library implementors. C++23 should be bringing additional support that should cover at least the most common use cases...

C++20 Coroutine Iterators--Martin Bond

The series continue.

C++20 Coroutine Iterators

by Martin Bond

From the article:

In my first blog post about C++20 Coroutines I introduced the concepts behind a synchronous or generator style coroutine and developed a template class to support coroutines for any data type.

In this post I’ll add an iterator to the template to support the range-for loop and iterative algorithms. You may want to review that post before reading this one but the following code should act as a reminder about how to write and use a coroutine to read two floating point values into a data structure for subsequent analysis...

CppCon 2019 Behind Enemy Lines - Reverse Engineering C++ in Modern Ages--Gal Zaban

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

Behind Enemy Lines - Reverse Engineering C++ in Modern Ages

by Gal Zaban

Summary of the talk:

What do C++ programs really look like? When developers think about hierarchy and virtual calls they see it as design patterns and code but reverse engineers look at it from a different angle, they think about Assembly puzzles.

C++ is known as a tangled language, templates, lambdas and pointers. All of these features create a jungle of objects intended to make life easier for the programmer. But once the program is compiled, the target program is no longer what it once seemed.

Reversing C++ programs is tedious, demanding, and requires rebuilding inheritance, identifying templates and tainting program flow in order to combat the ties of function overloading and class utilization.

C++ Binaries are a world of mysteries. In my presentation I am going to show how C++ binaries looks like after compilation and how reverse engineers see C++ binaries and understand their logic...

Find your dream C++ job at the Meeting C++ online job fair!

Next week is the 3rd online C++ job fair organized by Meeting C++. Attendees have the chance to talk to 8 C++ employers, more companies are welcome to join the event until next week! You can already submit your CV/resume via the upload form at Meeting C++ with the sponsors of the event.

Find your dream C++ job next week!

by Jens Weller

From the article:

The 3rd edition of the Meeting C++ online job fair is next week on September 28th & 29th!

Each of the events lasts 3 hours in which you can hop from table to table to meet with different employers! Right now you are able to already submit your application via the CV/resume sharing form with the 3 companies sponsoring the event. The event will be hosted for the first time on Hubilo, which features a lounge as the main event part. On Tuesday the event in in the European Afternoon, which is also great for folks from Asia/Oceania to join, while the event on wednesday evening (CEST) is easier to join for folks from the Americas and Europe/Africa.

CppCon 2020 Building a Coroutine based Job System without Standard Library--Tanki Zhang

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

Building a Coroutine based Job System without Standard Library

by Tanki Zhang

Summary of the talk:

A job system is a common game engine component to improve total CPU throughput. In this talk, I will walk through building a coroutine-based job system and explain the advantages of using coroutines over the typical ways to build a job system.

We shipped coroutines in C++20, but why does it matter for users, especially since there’s no standard library support? The answer is the coroutine semantics. Developers can customize the behavior of `co_return`, `co_yield`, `co_await` to build their own systems without any dependency of the standard library. For game developers, this is important because many game studios forbid the use of the standard library. The coroutine language feature itself is flexible enough to build a system with 100% control, which is exactly what engine developers want—no black box, no magic.

I will discuss the design decision I made, trade-offs, and current limitations. This talk is a crash course for system developers who want to build systems independently from the standard library and will also discuss possible future directions for this language feature.

This is an advanced coroutine talk and I expect attendees to have basic understanding about how (c++)coroutine works. Here is a useful link for some related materials if you want more information before attending this talk: https://gist.github.com/MattPD/9b55db...

C++20 Coroutines--Martin Bond

A first step.

C++20 Coroutines

by Martin Bond

From the article:

There seems to be a lot of confusion around the implementation of C++20 coroutines, which I think is due to the draft technical specification for C++20 stating that coroutines are a work in progress so we can’t expect full compiler and library support at this point in time.

A lot of the problems probably arise from the lack of official documentation about working with coroutines. We have been given C++ syntax support for coroutines (the co_yield and co_return) but without all of what I consider full library support. The standard library has hooks and basic functionality for supporting coroutines, but we must incorporate this into our own classes. I anticipate that there will be full library support for generator style coroutines in C++23.

The C++20 specification is obviously looking to provide support for parallel (or asynchronous) coroutines using co_await, which makes the implementation of a simpler generator style synchronous coroutines more complex. The implementation requirements for our coroutines utilises a Future and Promise mechanism similar to the std::async mechanism for asynchronous threads.

If you are a Python or C# developer expecting a simple coroutine mechanism, you’ll be disappointed because the C++20 general purpose framework is incomplete. Having said that, there are many blogs and articles on the web that include a template class that supports generator style coroutines. This blog contains a usable coroutine template and example code after discussing what a coroutine is...