November 2021

Conditional Members--Barry Revzin

Did you feel the need?

Conditional Members

by Barry Revzin

From the article:

I’d previously written a post about if constexpr (and how it’s not broken). I argued in that post how, broadly speaking, C++20 gives you the tools to solve the problems you want, even if they work a bit differently to D’s static if (with one notable exception, which this post greatly expands on). Now, over the past couple years, I’ve been working on a project that really is a deep dive into what Andrei calls “Design by Introspection.” This approach (for lack of a better definition), relies on conditioning functionality based on template parameters...

2021-11 Mailing Available

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

 

WG21 Number Title Author Document Date Mailing Date Previous Version Subgroup
P0009R14 MDSPAN Christian Trott 2021-11-14 2021-11 P0009R13 LEWG Library Evolution,LWG Library
P0323R11 std::expected JF Bastien 2021-11-16 2021-11 P0323R10 LWG Library
P0447R17 Introduction of std::hive to the standard library Matt Bentley 2021-11-03 2021-11 P0447R16 SG14 Low Latency,LEWG Library Evolution,All of WG21
P0533R9 constexpr for cmath and cstdlib Oliver Rosten 2021-11-12 2021-11 P0533R8 CWG Core,LWG Library
P1413R3 Deprecate std::aligned_storage and std::aligned_union CJ Johnson 2021-11-22 2021-11 P1413R2 LEWG Library Evolution,LWG Library
P1467R6 Extended floating-point types and standard names David Olsen 2021-11-10 2021-11 P1467R5 EWG Evolution,LEWG Library Evolution
P1467R7 Extended floating-point types and standard names David Olsen 2021-11-24 2021-11 P1467R6 EWG Evolution,LEWG Library Evolution
P1494R2 Partial program correctness S. Davis Herring 2021-11-12 2021-11 P1494R1 SG22 Compatability,EWG Evolution,LEWG Library Evolution,CWG Core
P1774R4 Portable assumptions Timur Doumler 2021-11-17 2021-11 P1774R3 EWG Evolution
P1854R2 Conversion to literal encoding should not lead to loss of meaning Corentin Jabot 2021-11-23 2021-11 P1854R1 SG16 Unicode
P1899R1 stride_view Christopher Di Bella 2021-11-08 2021-11 P1899R0 SG9 Ranges,LEWG Library Evolution
P2071R1 Named universal character escapes Tom Honermann 2021-11-09 2021-11 P2071R0 SG16 Unicode,EWG Evolution
P2093R10 Formatted output Victor Zverovich 2021-11-13 2021-11 P2093R9 LEWG Library Evolution
P2198R3 Freestanding Feature-Test Macros and Implementation-Defined Extensions Ben Craig 2021-11-12 2021-11 P2198R2 SG10 Feature Test,LEWG Library Evolution
P2249R3 Mixed comparisons for smart pointers Giuseppe D'Angelo 2021-11-16 2021-11 P2249R2 LEWG Library Evolution
P2273R3 Making std::unique_ptr constexpr Andreas Fertig 2021-11-09 2021-11 P2273R2 LWG Library
P2278R2 cbegin should always return a constant iterator Barry Revzin 2021-11-16 2021-11 P2278R1 LEWG Library Evolution
P2286R3 Formatting Ranges Barry Revzin 2021-11-16 2021-11 P2286R2 LEWG Library Evolution
P2302R1 std::ranges::contains Christopher Di Bella 2021-11-08 2021-11 P2302R0 SG9 Ranges
P2338R2 Freestanding Library: Character primitives and the C library Ben Craig 2021-11-11 2021-11 P2338R1 SG14 Low Latency,SG22 Compatability,LEWG Library Evolution
P2361R4 Unevaluated strings Corentin Jabot 2021-11-23 2021-11 P2361R3 EWG Evolution
P2388R4 Minimum Contract Support: either No_eval or Eval_and_abort Andrzej Krzemieński 2021-11-15 2021-11 P2388R3 SG21 Contracts,SG22 Compatability
P2407R1 Freestanding Library: Partial Classes Emil Meissner 2021-11-23 2021-11 P2407R0 LEWG Library Evolution
P2408R3 Ranges iterators as inputs to non-Ranges algorithms David Olsen 2021-11-08 2021-11 P2408R2 SG9 Ranges,LEWG Library Evolution
P2408R4 Ranges iterators as inputs to non-Ranges algorithms David Olsen 2021-11-16 2021-11 P2408R3 LEWG Library Evolution
P2441R1 views::join_with Barry Revzin 2021-11-16 2021-11 P2441R0 LEWG Library Evolution
P2443R1 views::chunk_by Tim Song 2021-11-19 2021-11 P2443R0 LWG Library
P2446R1 views::all_move Barry Revzin 2021-11-16 2021-11 P2446R0 LEWG Library Evolution
P2454R0 2021 November Library Evolution Polls Bryce Adelstein Lelbach 2021-11-03 2021-11   LEWG Library Evolution
P2461R1 Closure-based Syntax for Contracts Gašper Ažman 2021-11-15 2021-11 P2461R0 SG21 Contracts
P2467R0 Support exclusive mode for fstreams Jonathan Wakely 2021-11-15 2021-11   LEWG Library Evolution
P2477R1 Allow programmer to control and detect coroutine elision by static constexpr bool must_elide() and Chuanqi Xu 2021-10-25 2021-11 P2477R0 EWG Evolution,LEWG Library Evolution
P2477R2 Allow programmer to control and detect coroutine elision Chuanqi Xu 2021-11-14 2021-11 P2477R1 EWG Evolution,LEWG Library Evolution
P2483R0 Support Non-copyable Types for single_view Hui Xie 2021-10-26 2021-11   LEWG Library Evolution
P2484R0 Extending class types as non-type template parameters Richard Smith 2021-11-16 2021-11   EWG Evolution
P2485R0 Do not add value_exists and value_or to C++23 Jonathan Wakely 2021-11-01 2021-11   LEWG Library Evolution
P2486R0 Structured naming for function object and CPO values Kirk Shoop 2021-11-01 2021-11   LEWG Library Evolution
P2487R0 Attribute-like syntax for contract annotations Andrzej Krzemieński 2021-11-12 2021-11   SG21 Contracts,EWG Evolution
P2489R0 Library Evolution Plan for Completing C++23 Bryce Adelstein Lelbach 2021-11-09 2021-11   LEWG Library Evolution
P2490R0 Zero-overhead exception stacktraces Antony Peacock 2021-11-25 2021-11   LEWGI SG18: LEWG Incubator
P2491R0 Text encodings follow-up Jens Maurer 2021-11-15 2021-11   SG16 Unicode,LEWG Library Evolution
P2492R0 Attending C++ Standards Committee Meetings During a Pandemic René Ferdinand Rivera Morell 2021-11-09 2021-11   All of WG21
P2493R0 Missing feature test macros for C++20 core papers Barry Revzin 2021-11-15 2021-11   CWG Core

C++20: Heterogeneous Lookup in (Un)ordered Containers--Bartlomiej Filipek

Did you know?

C++20: Heterogeneous Lookup in (Un)ordered Containers

by Bartlomiej Filipek

From the article:

Would you like to gain 20…35 or even 50% speed improvements when searching in associative containers? In this blog post, we’ll explore a technique called “heterogenous access” that offers such impressive speedups. We’ll explore ordered containers, and the support for unordered collections added recently in C++20...

Virtual function calls in constructors and destructors

In different programming languages, the behavior of virtual functions differs when it comes to constructors and destructors. Incorrect use of virtual functions is a classic mistake. Developers often use virtual functions incorrectly. In this article, we discuss this classic mistake.

Virtual function calls in constructors and destructors

by Andrey Karpov

From the article:

So, what's the problem? You can find this information in any C++ programming book. The problem is that it's easy to forget about it! Thus, some programmers assume that foo and bar functions are called from the most derived C class. People keep asking the same question on forums: "Why does the code run in an unexpected way?" I think now you understand why it's easy to make a mistake in such code. Especially if you write code in other languages where the behavior is different. Let's look at the code fragment in C#.