News

2023-04 Mailing Available

The 2023-04 mailing of new standards papers is now available.

 

WG21 Number Title Author Document Date Mailing Date Previous Version Subgroup
N4943 WG21 February 2023 Issaquah Minutes of Meeting Nina Ranns 2023-03-06 2023-04   All of WG21
N4944 Working Draft, Standard for Programming Language C++ Thomas Köppe 2023-03-22 2023-04   All of WG21
N4945 Editors' Report - Programming Languages - C++ Thomas Köppe 2023-03-23 2023-04   All of WG21
P0876R13 fiber_context - fibers without scheduler Oliver Kowalke 2023-03-02 2023-04 P0876R12 LEWG Library Evolution
P1144R7 std::is_trivially_relocatable Arthur O'Dwyer 2023-03-10 2023-04 P1144R6 EWGI SG17: EWG Incubator,LEWGI SG18: LEWG Incubator,EWG Evolution,LEWG Library Evolution
P1673R12 A free function linear algebra interface based on the BLAS Mark Hoemmen 2023-03-14 2023-04 P1673R11 LWG Library
P1885R11 Naming Text Encodings to Demystify Them Corentin Jabot 2023-03-22 2023-04 P1885R10 LWG Library
P2022R1 Rangified version of lexicographical_compare_three_way Ran Regev 2023-03-11 2023-04 P2022R0 SG9 Ranges,LEWG Library Evolution
P2287R2 Designated-initializers for base classes Barry Revzin 2023-03-12 2023-04 P2287R1 EWG Evolution
P2407R3 Freestanding Library: Partial Classes Emil Meissner 2023-03-05 2023-04 P2407R2 LWG Library
P2447R3 std::span over an initializer list Arthur O'Dwyer 2023-03-14 2023-04 P2447R2 LEWG Library Evolution
P2530R3 Hazard Pointers for C++26 Maged Michael 2023-03-02 2023-04 P2530R2 LWG Library
P2545R4 Read-Copy Update (RCU) Paul E. McKenney 2023-03-08 2023-04 P2545R3 LWG Library
P2630R3 Submdspan Christian Trott 2023-03-15 2023-04 P2630R2 LEWG Library Evolution,LWG Library
P2690R1 Presentation for C++17 parallel algorithms and P2300 Ruslan Arutyunyan 2023-03-16 2023-04 P2690R0 SG1 Concurrency and Parallelism,LEWG Library Evolution
P2746R1 Deprecate and Replace Fenv Rounding Modes Hans Boehm 2023-03-14 2023-04 P2746R0 SG6 Numerics,LEWG Library Evolution
P2752R1 Static storage for braced initializers Arthur O'Dwyer 2023-03-10 2023-04 P2752R0 EWG Evolution,CWG Core
P2757R1 Type checking format args Barry Revzin 2023-03-13 2023-04 P2757R0 LEWG Library Evolution
P2780R0 Caller-side precondition checking, and Eval_and_throw Ville Voutilainen 2023-03-02 2023-04   SG21 Contracts
P2806R1 do expressions Barry Revzin 2023-03-12 2023-04 P2806R0 EWG Evolution
P2809R0 Trivial infinite loops are not Undefined Behavior JF Bastien 2023-03-14 2023-04   SG1 Concurrency and Parallelism,SG22 Compatability,EWG Evolution
P2811R0 Contract Violation Handlers Joshua Berne 2023-03-20 2023-04   SG21 Contracts
P2811R1 Contract Violation Handlers Joshua Berne 2023-03-20 2023-04 P2811R0 SG21 Contracts
P2817R0 The idea behind the contracts MVP Andrzej Krzemieński 2023-03-05 2023-04   SG21 Contracts
P2818R0 Uniform Call Syntax for explicit-object member functions Gašper Ažman 2023-03-15 2023-04   EWG Evolution
P2819R0 Add tuple protocol to complex Michael Florian Hava 2023-02-23 2023-04   SG6 Numerics,LEWG Library Evolution
P2824R0 WG21 February 2023 Issaquah meeting Record of Discussion Nina Ranns 2023-03-06 2023-04   All of WG21
P2825R0 calltarget(unevaluated-call-expression) Gašper Ažman 2023-03-15 2023-04   EWG Evolution
P2826R0 Replacement functions Gašper Ažman 2023-03-15 2023-04   EWG Evolution
P2827R0 Floating-point overflow and underflow in from_chars (LWG 3081) Zhihao Yuan 2023-03-14 2023-04   LEWG Library Evolution,LWG Library
P2828R0 Copy elision for direct-initialization with a conversion function (Core issue 2327) Brian Bi 2023-03-13 2023-04   CWG Core
P2830R0 constexpr type comparison Gašper Ažman 2023-03-15 2023-04   EWG Evolution
P2833R0 Freestanding Library: inout expected span Ben Craig 2023-03-13 2023-04   LEWG Library Evolution
P2836R0 std::const_iterator often produces an unexpected type Christopher Di Bella 2023-03-20 2023-04   SG9 Ranges,LEWG Library Evolution,LWG Library
P2838R0 Unconditional contract violation handling of any kind is a serious problem Ville Voutilainen 2023-03-22 2023-04   SG21 Contracts

Tonight 20:00 CEST/Berlin/Amsterdam: Meeting C++ online book & tool fair

Join us tonight (20:00 CEST/Berlin/Amsterdam) for the Meeting C++ online book & tool fair!

Meeting C++ online book & tool fair

About the event:

Tonight will featuring 3 tools and one book in the fair and the kick off livestream with demos at 20:00 CEST:

  • Undo.io
  • Modern C++ for absolute Beginners by Slobodan Dmitrović
  • Conan 2.0
  • KDABs open source tools: hotspot, heaptrack, gammaray and more

The second part of the event will be in the Hubilo lounge, where you can visit each of the above tools and books at their own table and ask your questions!

C++20: consteval and constexpr Functions -- Daniel Lemire

Optimizing compilers seek try to push as much of the computation as possible at compile time.

C++20: consteval and constexpr Functions

by Daniel Lemire

From the article:

In modern C++, you can declare a function as ‘constexpr’, meaning that you state explicitly that the function may be executed at compile time.

The constexpr qualifier is not magical. There may not be any practical difference in practice between an inline function and a constexpr function, as in this example:

inline int f(int x) {
  return x+1;
}

constexpr int fc(int x) {
  return x+1;
}

Functional exception-less error handling with C++23’s optional and expected -- Sy Brand

std::optional has been updated in C++23, and std::expected added as a new way of representing errors in your code. Read more about them here:

Functional exception-less error handling with C++23’s optional and expected

by Sy Brand

From the article:

std::optional<T> expresses “either a T or nothing”. C++23 comes with a new type, std::expected<T,E> which expresses “either the expected T, or some E telling you what went wrong”. This type also comes with that special new functional interface. As of Visual Studio 2022 version 17.6 Preview 3, all of these features are available in our standard library. Armed with an STL implementation you can try yourself, I’m going to exhibit how to use std::optional‘s new interface, and the new std::expected to handle disappointments.

Simple Usage of C++20 Modules -- Victor Zverovich

SimpleUsage-Zverovich.jpgIn my previous post I showed how to compile {fmt} as a C++20 module with clang. Although taking only two commands, ideally it’s not something you should be doing manually. So in this post, I’ll talk about module support in CMake, everyone’s favorite not a build system.

Simple Usage of C++20 Modules

by Victor Zverovich

From the article:

My first attempt was to use the CMake’s built-in functionality advertised in “import CMake; C++20 Modules”. And after some struggle I made it to work with clang but unfortunately it was very limited. Here are some of the problems and limitations that I discovered:

  1. It only worked with ninja and while I don’t have anything against this build system it’s an extra hassle to get this additional dependency installed while make is usually available by default. This restriction also likely means that you cannot use such a CMake config with IDEs.
  2. Native CMake support only worked with clang 16 while the fmt module can be built manually with clang 15.
  3. It required the latest version of CMake and a lot of ceremony to set up, including some incomprehensible things.
  4. There were issues in dynamic dependency extraction both in clang-scan-deps and CMake itself.

 

Functional Exception-less Error Handling with C++23’s Optional and Expected -- Sy Brand

This post is an updated version of an article from five years ago, now that everything Sy talked about is in the standard and implemented in Visual Studio.

Functional Exception-less Error Handling with C++23’s Optional and Expected

by Sy Brand

From the article:

In software things can go wrong. Sometimes we might expect them to go wrong. Sometimes it’s a surprise. In most cases we want to build in some way of handling these misfortunes. Let’s call them disappointments.

std::optional was added in C++17 to provide a new standard way of expressing disappointments and more, and it has been extended in C++23 with a new interface inspired by functional programming.

C++23’s New Fold Algorithms -- Sy Brand

This post explains the benefits of the new “rangified” algorithms, talks you through the new C++23 additions, and explores some of the design space for fold algorithms in C++.

C++23’s New Fold Algorithms

by Sy Brand

From the article:

C++20’s algorithms make several improvements to the old iterator-based ones. The most obvious is that they now can take a range instead of requiring you to pass iterator pairs. But they also allow passing a “projection function” to be called on elements of the range before being processed, and the use of C++20 concepts for constraining their interfaces more strictly defines what valid uses of these algorithms are. These changes allow you to make refactors like:

// C++17 algorithm
cat find_kitten(const std::vector<cat>& cats) {
    return *std::find_if(cats.begin(), cats.end(),
        [](cat const& c) { return c.age == 0; });
}

// C++20 algorithm
cat find_kitten(std::span<cat> cats) {
    return *std::ranges::find(cats, 0, &cat::age);
}

2023 Annual C++ Developer Survey "Lite"

cpp_logo.png

The annual global C++ developer survey is now open. As the name suggests, it's a one-pager:

2023 Annual C++ Developer Survey "Lite"

Please take 10 minutes or so to participate! A summary of the results, including aggregated highlights of common answers in the write-in responses, will be posted publicly here on isocpp.org and shared with the C++ standardization committee participants to help inform C++ evolution.

The survey closes in one week.

Thank you for participating and helping to inform our committee and community!

Broker -- Rainer Grimm

The Broker Pattern structures distributed software systems that interact with remote service invocations. It is responsible for coordinating the communication, its results, and exceptions.

Broker

by Rainer Grimm

From the article:

The Broker Pattern from the book  "Pattern-Oriented Software Architecture, Volume 1" helps solve many challenges of distributed systems, such as finding the appropriate service provider, communicating with them securely, using the right programming language, or dealing with errors. This will not go into the details. It should only provide you with a rough idea of the Broker Pattern. For further information, study the pattern in the book "Pattern-Oriented Software Architecture, Volume 1".