PVS-Studio 7.33: SN-DBS support

PVS-Studio 7.33 has been released. Check out the latest features, including SN-DBS support, C# user annotations, and other exciting updates! See more details in this note.

PVS-Studio 7.33: SN-DBS support

by Valerii Filatov

From the article:

To enhance the integration of PVS-Studio with Unreal Engine, we've introduced support for SN-DBS, a distributed build system. These changes apply to Unreal Engine 5.5. Learn more about using PVS-Studio with Unreal Engine in the documentation.

2024-10 Mailing Available

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

 

WG21 Number Title Author Document Date Mailing Date Previous Version Subgroup
N4991 2025 Sofia Meeting Invitation and Information Vassil Vassilev 2024-10-16 2024-10   All of WG21
N4993 Working Draft, Programming Languages -- C++ Thomas Köppe 2024-10-16 2024-10   All of WG21
N4994 Editors' Report, Programming Languages -- C++ Thomas Köppe 2024-10-16 2024-10   All of WG21
P0260R11 C++ Concurrent Queues Detlef Vollmann 2024-10-12 2024-10 P0260R10 SG1 Concurrency and Parallelism,LEWG Library Evolution
P0707R5 Metaclass functions for generative C++ Herb Sutter 2024-10-15 2024-10 P0707R4 SG7 Reflection,EWG Evolution
P0876R18 fiber_context - fibers without scheduler Oliver Kowalke 2024-10-16 2024-10 P0876R17 EWG Evolution,CWG Core,LWG Library
P1144R12 std::is_trivially_relocatable Arthur O'Dwyer 2024-10-14 2024-10 P1144R11 EWGI SG17: EWG Incubator
P1255R14 A view of 0 or 1 elements: views::nullable And a concept to constrain maybes Steve Downey 2024-10-16 2024-10 P1255R13 LEWG Library Evolution,LWG Library
P1306R3 Expansion statements Dan Katz 2024-10-14 2024-10 P1306R2 EWG Evolution
P1494R4 Partial program correctness S. Davis Herring 2024-10-15 2024-10 P1494R3 SG22 Compatibility,EWG Evolution,LEWG Library Evolution,CWG Core
P1708R9 Basic Statistics Richard Dosselmann 2024-10-14 2024-10 P1708R8 SG6 Numerics,SG14 Low Latency,SG19 Machine Learning,LEWG Library Evolution,LWG Library
P1729R5 Text Parsing Elias Kosunen 2024-10-15 2024-10 P1729R4 SG16 Unicode,LEWG Library Evolution
P1839R6 Accessing object representations Brian Bi 2024-10-14 2024-10 P1839R5 CWG Core
P1928R12 std::simd - Merge data-parallel types from the Parallelism TS 2 Matthias Kretz 2024-10-11 2024-10 P1928R11 LWG Library
P2079R5 System execution context Lucian Radu Teodorescu 2024-10-16 2024-10 P2079R4 SG1 Concurrency and Parallelism,LEWG Library Evolution
P2319R2 Prevent path presentation problems Victor Zverovich 2024-09-28 2024-10 P2319R1 LEWG Library Evolution
P2392R3 Pattern matching using is and as Herb Sutter 2024-10-16 2024-10 P2392R2 EWG Evolution
P2434R2 Nondeterministic pointer provenance S. Davis Herring 2024-10-15 2024-10 P2434R1 SG22 Compatibility,EWG Evolution,CWG Core
P2645R0 path_view: a design that took a wrong turn Victor Zverovich 2024-10-12 2024-10   LEWG Library Evolution
P2664R8 Proposal to extend std::simd with permutation API Daniel Towner 2024-10-15 2024-10 P2664R7 SG1 Concurrency and Parallelism,LEWG Library Evolution
P2688R3 Pattern Matching: `match` Expression Michael Park 2024-10-16 2024-10 P2688R2 EWG Evolution
P2719R1 Type-aware allocation and deallocation functions Louis Dionne 2024-10-16 2024-10 P2719R0 EWG Evolution
P2728R7 Unicode in the Library, Part 1: UTF Transcoding Zach Laine 2024-10-07 2024-10 P2728R6 SG9 Ranges,SG16 Unicode,LEWG Library Evolution
P2746R6 Deprecate and Replace Fenv Rounding Modes Hans Boehm 2024-10-14 2024-10 P2746R5 SG6 Numerics,LEWG Library Evolution
P2769R3 get_element customization point object Ruslan Arutyunyan 2024-10-16 2024-10 P2769R2 LEWG Library Evolution
P2786R8 Trivial Relocatability For C++26 Mungo Gill 2024-10-16 2024-10 P2786R7 EWG Evolution,LEWG Library Evolution
P2841R5 Concept and variable-template template-parameters Corentin Jabot 2024-10-16 2024-10 P2841R4 CWG Core
P2846R4 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges Corentin Jabot 2024-10-15 2024-10 P2846R3 LEWG Library Evolution
P2900R10 Contracts for C++ Joshua Berne 2024-10-13 2024-10 P2900R9 EWG Evolution,LEWG Library Evolution
P2900R9 Contracts for C++ Joshua Berne 2024-10-13 2024-10 P2900R8 EWG Evolution,LEWG Library Evolution
P2933R2 std::simd overloads for <bit> header Daniel Towner 2024-10-16 2024-10 P2933R1 LWG Library
P2957R2 Contracts and coroutines Andrzej Krzemieński 2024-10-14 2024-10 P2957R1 SG21 Contracts,EWG Evolution
P2977R2 Build database files Ben Boeckel 2024-10-15 2024-10 P2977R1 SG15 Tooling
P2988R8 std::optional<T&> Steve Downey 2024-10-15 2024-10 P2988R7 LEWG Library Evolution,LWG Library
P2996R6 Reflection for C++26 Barry Revzin 2024-10-09 2024-10 P2996R5 EWG Evolution
P2996R7 Reflection for C++26 Barry Revzin 2024-10-12 2024-10 P2996R6 EWG Evolution
P2998R0 CTAD for function parameter types James Touton 2024-10-15 2024-10   EWGI SG17: EWG Incubator,EWG Evolution
P3019R10 Vocabulary Types for Composite Class Design Jonathan Coe 2024-09-30 2024-10 P3019R9 LEWG Library Evolution,LWG Library
P3045R2 Quantities and units library Mateusz Pusz 2024-10-09 2024-10 P3045R1 SG6 Numerics,SG16 Unicode,LEWG Library Evolution
P3045R3 Quantities and units library Mateusz Pusz 2024-10-15 2024-10 P3045R2 SG6 Numerics,SG16 Unicode,LEWG Library Evolution
P3049R1 node-handles for lists Michael Florian Hava 2024-10-15 2024-10 P3049R0 LEWG Library Evolution
P3070R1 Formatting enums Victor Zverovich 2024-10-13 2024-10 P3070R0 LEWG Library Evolution
P3081R0 Core safety Profiles: Specification, adoptability, and impact Herb Sutter 2024-10-15 2024-10   SG15 Tooling,SG23 Safety and Security,EWG Evolution
P3091R3 Better lookups for `map` and `unordered_map` Pablo Halpern 2024-10-14 2024-10 P3091R2 LEWG Library Evolution
P3094R4 std::basic_fixed_string Mateusz Pusz 2024-10-09 2024-10 P3094R3 SG16 Unicode,LEWG Library Evolution
P3094R5 std::basic_fixed_string Mateusz Pusz 2024-10-15 2024-10 P3094R4 LEWG Library Evolution
P3098R0 Contracts for C++: Postcondition captures Timur Doumler 2024-10-14 2024-10   SG21 Contracts,EWG Evolution
P3100R1 Undefined and erroneous behaviour are contract violations Timur Doumler 2024-10-16 2024-10 P3100R0 SG21 Contracts,SG23 Safety and Security,EWG Evolution
P3100R1 Undefined and erroneous behaviour are contract violations Timur Doumler 2024-10-16 2024-10 P3100R0 SG21 Contracts,SG23 Safety and Security,EWG Evolution
P3125R1 constexpr pointer tagging Hana Dusíková 2024-10-16 2024-10 P3125R0 SG1 Concurrency and Parallelism,LEWG Library Evolution
P3138R3 views::cache_latest Tim Song 2024-10-15 2024-10 P3138R2 LEWG Library Evolution
P3149R6 async_scope -- Creating scopes for non-sequential concurrency Ian Petersen 2024-10-15 2024-10 P3149R5 SG1 Concurrency and Parallelism,LEWG Library Evolution
P3152R0 Add missing constructors and assignment for indirect and polymorphic Jonathan Coe 2024-09-30 2024-10   LEWG Library Evolution
P3160R2 An allocator-aware `inplace_vector` Pablo Halpern 2024-10-14 2024-10 P3160R1 LEWG Library Evolution
P3179R3 C++ parallel range algorithms Ruslan Arutyunyan 2024-10-16 2024-10 P3179R2 SG1 Concurrency and Parallelism,SG9 Ranges,LEWG Library Evolution
P3227R0 Contracts for C++: Fixing the contract violation handling API Gašper Ažman 2024-10-16 2024-10   SG21 Contracts,LEWG Library Evolution
P3237R1 Matrix Representation of Contract Semantics Andrei Zissu 2024-10-16 2024-10 P3237R0 SG21 Contracts
P3261R0 Revisiting `const`-ification in Contract Assertions Joshua Berne 2024-10-02 2024-10   SG21 Contracts,EWG Evolution
P3261R1 Revisiting `const`-ification in Contract Assertions Joshua Berne 2024-10-13 2024-10 P3261R0 SG21 Contracts,EWG Evolution
P3271R1 Function Types with Usage (Contracts for Function Pointers) Lisa Lippincott 2024-10-14 2024-10 P3271R0 SG21 Contracts
P3287R1 Exploration of namespaces for std::simd Matthias Kretz 2024-10-15 2024-10 P3287R0 LEWG Library Evolution
P3293R1 Splicing a base class subobject Barry Revzin 2024-10-13 2024-10 P3293R0 EWG Evolution
P3294R2 Code Injection with Token Sequences Barry Revzin 2024-10-15 2024-10 P3294R1 SG7 Reflection,EWG Evolution
P3295R2 Freestanding constexpr containers and constexpr exception types Ben Craig 2024-10-12 2024-10 P3295R1 LEWG Library Evolution
P3296R2 let_async_scope Anthony Williams 2024-10-14 2024-10 P3296R1 SG1 Concurrency and Parallelism,LEWG Library Evolution
P3298R1 Implicit user-defined conversion functions as operator.() Bengt Gustafsson 2024-10-15 2024-10 P3298R0 EWG Evolution
P3299R2 Range constructors for std::simd Daniel Towner 2024-10-16 2024-10 P3299R1 LEWG Library Evolution
P3310R3 Solving partial ordering issues introduced by P0522R0 Matheus Izvekov 2024-10-14 2024-10 P3310R2 EWG Evolution,CWG Core
P3310R4 Solving issues introduced by P0522R0 Matheus Izvekov 2024-10-15 2024-10 P3310R3 EWG Evolution,CWG Core
P3324R0 Attributes for namespace aliases, template parameters, and lambda captures Tom Honermann 2024-10-14 2024-10   EWG Evolution
P3327R0 Contract assertions on function pointers Timur Doumler 2024-10-16 2024-10   SG21 Contracts,EWG Evolution
P3334R0 Cross Static Variables Coral Kashri 2024-10-15 2024-10   SG7 Reflection,EWGI SG17: EWG Incubator
P3335R2 Structured Core Options René Ferdinand Rivera Morell 2024-10-15 2024-10 P3335R1 SG15 Tooling
P3346R0 thread_local means fiber-specific Nat Goodspeed 2024-10-16 2024-10   EWG Evolution,LEWG Library Evolution
P3348R1 C++26 should refer to C23 not C17 Jonathan Wakely 2024-10-14 2024-10 P3348R0 SG6 Numerics,LEWG Library Evolution
P3349R0 Converting contiguous iterators to pointers Jonathan Wakely 2024-10-16 2024-10   LEWG Library Evolution
P3351R1 views::scan Yihe Li 2024-10-09 2024-10 P3351R0 SG9 Ranges
P3352R0 Taming the Demons (C++ version) - Undefined Behavior and Partial Program Correctness Andrew Tomazos, Martin Uecker 2024-09-19 2024-10   SG22 Compatibility,EWG Evolution
P3355R1 Fix submdspan for C++26 Mark Hoemmen 2024-10-15 2024-10 P3355R0 LWG Library
P3367R0 constexpr coroutines Hana Dusíková 2024-10-16 2024-10   EWG Evolution,LEWG Library Evolution
P3370R1 Add new library headers from C23 Jens Maurer 2024-10-06 2024-10 P3370R0 LEWG Library Evolution
P3371R2 Fix C++26 by making the rank-1, rank-2, rank-k, and rank-2k updates consistent with the BLAS Mark Hoemmen 2024-10-14 2024-10 P3371R1 LEWG Library Evolution
P3372R2 constexpr containers and adapters Hana Dusíková 2024-10-08 2024-10 P3372R1 LEWG Library Evolution
P3375R1 Reproducible floating-point results Guy Davidson 2024-10-08 2024-10 P3375R0 SG6 Numerics,SG14 Low Latency,LEWG Library Evolution
P3376R0 Contract assertions versus static analysis and 'safety' Andrzej Krzemieński 2024-10-14 2024-10   SG21 Contracts,EWG Evolution
P3378R0 constexpr exception types Hana Dusíková 2024-10-14 2024-10   LEWG Library Evolution
P3385R1 Attributes reflection Aurelien Cassagnes 2024-10-14 2024-10 P3385R0 SG7 Reflection
P3386R0 Static Analysis of Contracts with P2900 Joshua Berne 2024-10-15 2024-10   EWG Evolution
P3387R0 Contract assertions on coroutines Timur Doumler 2024-10-09 2024-10   SG21 Contracts,EWG Evolution
P3394R0 Annotations for Reflection Daveed Vandevoorde 2024-10-14 2024-10   SG7 Reflection,EWG Evolution
P3399R0 Adjusting Electronic Polls to a Hybrid Workflow Inbal Levi 2024-10-16 2024-10   LEWG Library Evolution,All of WG21
P3402R1 A Safety Profile Verifying Class Initialization Marc-André Laverdière 2024-10-14 2024-10 P3402R0 SG23 Safety and Security
P3403R0 The Undefined Behavior Question Andrew Tomazos 2024-09-19 2024-10   EWG Evolution
P3404R0 std::at : Range-checked accesses to arbitrary containers Andre Kostur 2024-10-11 2024-10   SG9 Ranges,SG23 Safety and Security
P3405R0 Out-of-order designated initializers Elias Kosunen 2024-09-28 2024-10   EWG Evolution
P3406R0 We need better performance testing Bjarne Stroustrup 2024-09-24 2024-10   All of WG21
P3407R0 Make idiomatic usage of `offsetof` well-defined Brian Bi 2024-10-14 2024-10   EWG Evolution
P3409R0 Enabling more efficient stop-token based cancellation of senders Lewis Baker 2024-10-16 2024-10   SG1 Concurrency and Parallelism
P3411R0 `any_view` Hui Xie 2024-09-29 2024-10   SG9 Ranges,LEWG Library Evolution
P3412R0 String interpolation Bengt Gustafsson 2024-10-15 2024-10   EWGI SG17: EWG Incubator,EWG Evolution
P3413R0 A more flexible optional::value_or (else!) Corentin Jabot 2024-10-15 2024-10   LEWG Library Evolution
P3415R0 Range interface in std::optional breaks code! Andrzej Krzemieński 2024-10-10 2024-10   LEWG Library Evolution
P3416R0 exception_ptr_cast: Add && = delete overload Gor Nishanov 2024-10-14 2024-10   LEWG Library Evolution
P3417R0 Improving the handling of exceptions thrown from contract predicates Gašper Ažman 2024-10-16 2024-10   SG21 Contracts,EWG Evolution
P3419R0 Reflection Syntax Options Summary Michael Levine 2024-10-11 2024-10   SG7 Reflection,EWGI SG17: EWG Incubator,EWG Evolution
P3420R0 Reflection of Templates Andrei Alexandrescu 2024-10-16 2024-10   SG7 Reflection
P3421R0 Consteval destructors Ben Craig 2024-10-12 2024-10   SG7 Reflection,EWG Evolution
P3422R0 Allow main function in named modules   2024-10-09 2024-10   EWG Evolution
P3423R0 Extending User-Generated Diagnostic Messages Yihe Li 2024-10-15 2024-10   EWG Evolution
P3425R0 Reducing operation-state sizes for subobject child operations Lewis Baker 2024-10-16 2024-10   LEWG Library Evolution
P3427R0 Hazard Pointer Synchronous Reclamation Maged Michael 2024-10-11 2024-10   SG1 Concurrency and Parallelism
P3428R0 Hazard Pointer Batches Maged Michael 2024-10-11 2024-10   SG1 Concurrency and Parallelism
P3429R0 Reflection header should minimize standard library dependencies Jonathan Müller 2024-10-16 2024-10   LEWG Library Evolution
P3430R0 simd issues: explicit, unsequenced, identity-element position, and members of disabled simd Matthias Kretz 2024-10-15 2024-10   LEWG Library Evolution
P3433R0 Allocator Support for Operation States Dietmar Kuehl 2024-10-14 2024-10   LEWG Library Evolution
P3435R0 Reflection and meta-programming Jean-Baptiste VALLON HOARAU 2024-10-14 2024-10   SG7 Reflection
P3436R0 Strategy for removing safety-related undefined behavior by default Herb Sutter 2024-10-16 2024-10   SG23 Safety and Security,EWG Evolution
P3437R0 Proposed default principles: Reflect C++, Generate C++ Herb Sutter 2024-10-16 2024-10   SG7 Reflection,EWG Evolution
P3438R0 Make integral overloads of std::to_string constexpr Andreas Fertig 2024-10-13 2024-10   LEWG Library Evolution
P3439R0 Chained comparisons: Safe, correct, efficient Herb Sutter 2024-10-15 2024-10   EWG Evolution
P3440R0 Add n_elements named constructor to std::simd Daniel Towner 2024-10-15 2024-10   LEWG Library Evolution
P3441R0 Rename simd_split to simd_chunk Daniel Towner 2024-10-15 2024-10   LEWG Library Evolution
P3442R0 [[invalidate_dereferencing]] attribute Patrice Roy 2024-10-14 2024-10   SG14 Low Latency,LEWG Library Evolution
P3443R0 Reflection on SG21 2024 Process Ran Regev 2024-10-14 2024-10   SG21 Contracts,EWG Evolution
P3444R0 Memory safety without lifetime parameters Sean Baxter 2024-10-14 2024-10   SG23 Safety and Security
P3445R0 Add utilities for easier type/bit casting in std::simd Daniel Towner 2024-10-16 2024-10   LEWG Library Evolution
P3446R0 Profile invalidation - eliminating dangling pointers Bjarne Stroustrup 2024-10-14 2024-10   SG23 Safety and Security
P3447R0 Profiles syntax Bjarne Stroustrup 2024-10-14 2024-10   SG23 Safety and Security
P3449R0 constexpr std::generator Hana Dusíková 2024-10-14 2024-10   LEWG Library Evolution
P3450R0 Extending is_within_lifetime Barry Revzin 2024-10-14 2024-10   LEWG Library Evolution
P3451R0 A Suggestion for Reflection Access Control Barry Revzin 2024-10-14 2024-10   EWG Evolution
P3454R0 Revising Atomic Max/Min Operations Michael Wong 2024-10-15 2024-10   SG1 Concurrency and Parallelism
P3455R0 SG14: Low Latency/Games/Embedded/Financial Trading virtual Meeting Minutes 2024/6/12-2024/10/9 Michael Wong 2024-10-14 2024-10   SG14 Low Latency
P3456R0 system_scheduler on Win32, Darwin and Linux Gor Nishanov 2024-10-15 2024-10   SG1 Concurrency and Parallelism,LEWG Library Evolution,LWG Library
P3457R0 SG19: Machine Learning virtual Meeting Minutes to 2024/06/13-2024/10/10 Michael Wong 2024-10-14 2024-10   SG19 Machine Learning
P3460R0 Contracts Implementors Report Eric Fiselier, Nina Dinka Ranns, Iain Sandoe 2024-10-16 2024-10   SG21 Contracts,EWG Evolution,CWG Core
P3465R0 Pursue P1179 as a Lifetime TS Herb Sutter 2024-10-15 2024-10   SG23 Safety and Security,EWG Evolution
P3466R0 (Re)affirm design principles for future C++ evolution Herb Sutter 2024-10-16 2024-10   EWG Evolution
P3467R0 2024-10 Library Evolution Polls Inbal Levi 2024-10-16 2024-10   LEWG Library Evolution
P3469R0 Virtual deducing this Mike Spertus 2024-10-16 2024-10   EWG Evolution
P3470R0 Interface-Unit-Only Module Library Support Daniel Ruoso 2024-10-15 2024-10   SG15 Tooling,EWG Evolution
P3471R0 Standard library hardening Konstantin Varlamov 2024-10-15 2024-10   SG23 Safety and Security,LEWG Library Evolution
P3472R0 Make fiber_context::can_resume() const Andrzej Krzemieński 2024-10-15 2024-10   LEWG Library Evolution
P3473R0 Splicing Should Respect Access Control Steve Downey 2024-10-16 2024-10   EWG Evolution
P3474R0 std::arguments Jeremy Rifkin 2024-10-15 2024-10   EWGI SG17: EWG Incubator,LEWGI SG18: LEWG Incubator
P3475R0 Defang and deprecate memory_order::consume Hans Boehm 2024-10-15 2024-10   SG1 Concurrency and Parallelism,EWG Evolution,LEWG Library Evolution,CWG Core,LWG Library
P3476R0 Slides for P2688R2 - Pattern Matching: `match` Expression Michael Park 2024-10-16 2024-10   EWG Evolution
P3477R0 There are exactly 8 bits in a byte JF Bastien 2024-10-16 2024-10   SG22 Compatibility,EWG Evolution,LEWG Library Evolution
P3478R0 Constification should not be part of the MVP John Spicer 2024-10-16 2024-10   SG21 Contracts,EWG Evolution
P3479R0 Enabling C pragma support in C++ Joshua Cranmer 2024-10-16 2024-10   SG6 Numerics,EWGI SG17: EWG Incubator,SG22 Compatibility
P3480R0 std::simd is a range Matthias Kretz 2024-10-16 2024-10   SG9 Ranges,LEWG Library Evolution
P3481R0 Summarizing std::execution::bulk() issues Lucian Radu Teodorescu 2024-10-16 2024-10   SG1 Concurrency and Parallelism,LEWG Library Evolution

Synchronization Primitives in C++20 -- Shivam Kunwar

El5Swmxm_400x400.jpgIn C++20, the standard library introduced new synchronization primitives: std::latch and std::barrier. These are the utilities designed to coordinate between concurrent threads.

Synchronization Primitives in C++20

by Shivam Kunwar

From the article:

What is a synchronization primitive?

In concurrent programming, synchronization primitives are the fundamental tools that help in managing the coordination, execution order, and data safety of multiple threads or processes that run concurrently.

Briefly said, they ensure that:

  • multiple threads don’t simultaneously execute some specific segment of code (a “critical section”)
  • the program and the data remain in a consistent state
  • deadlocks (where threads wait indefinitely for resources) and race conditions (where the outcome depends on the timing of accessing the shared data by a thread) are prevented or managed

There are multiple synchronization primitives in C++; for example, mutual exclusion, condition variables, atomic operations, locking mechanisms, etc.

In C++20, we have two additional synchronization primitives: latches and barriers.

Let’s discuss both of them.

std::latch

A std::latch is a synchronization primitive that permits a certain number of count_down operations (decrements) before allowing one or more threads to pass the wait point. A latch cannot be reused once its internal counter reaches zero.

How do we use a latch?

  • A std::latch object is created with an initial count.
  • Multiple threads can decrement this count using the count_down method.
  • Threads can call wait, which block until the internal count of the latch reaches zero.

 

30 days until Meeting C++ 2024!

Meeting C++ 2024 is just 30 days away! Come to Berlin and meet with the C++ Community and the C++ committee for 3 days!

The Schedule of Meeting C++ 2024

by Jens Weller

From the page:

Meeting C++ 2024 features 4 keynotes, 3 tracks onsite and one online track, the conference is live streamed from Berlin. All Tickets include access to the videos after the conference.

This years keynotes are Titus Winters, Hana Dusíková, Herb Sutter and Peter Sommerlad!

C++ semantics

The PVS-Studio Team invite you to the webinar. Date: November 06, 2024, 12:00 PM UTC+1.

C++ semantics

by Yuri Minaev

Summary of the talk:

In this talk on the С++ semantics, we will take a look at symbols and name resolution. We will discuss different kinds of lookups, scope importing, overload resolution, as well as templates and their specifics. Speaker: Yuri Minaev.

Write Modern Code with Features of C++17 and C++20 -- Andreas Fertig

me.pngWhen you transition from older C++ standards like C++11 or C++14 to the latest C++17 and C++20 it can be a tough journey. It's essential for writing clean and easy-to-maintain code, but many developers find the process challenging.

Write Modern Code with Features of C++17 and C++20

by Andreas Fertig

From the article:

Here are three common hurdles:

1. Variety of New Features

Adapting to C++17 and C++20 can be intimidating. As the latest standards offer a wide range of new features and syntax changes. One such feature is the introduction of structured bindings in C++17, which represents a shift from how variables were traditionally declared and accessed.

Old Way (C++14 and Earlier):

Before C++17, when you needed to unpack values from a pair or a tuple, you would typically do something like this:

fertigmodencode.png

Here, you need to use std::get<>() to access each element of the tuple, which is both verbose and less intuitive, especially when dealing with more complex data structures.

C++ Compile-Time Programming -- Yongwei Wu

<img alt="ACCU" data-cke-saved-src="https://isocpp.org/files/img/logo.png" src="https://isocpp.org/files/img/logo.png" 225px;="" height:="" 60px;="" float:="" right;"="" style="float: right;">Programming at compile time has been possible in C++ for a long time. Yongwei Wu considers its past, present, and future.

C++ Compile-Time Programming

by Yongwei Wu

From the article:

Compile-time programming is a key feature of C++. It enables writing high-performance code often unattainable in other languages. This article explores its past, present, and future applications, highlighting the diverse possibilities in C++. We’ll briefly cover template metaprogramming, constexpr, variadic templates, static reflection, and more.

 

How To Convert Unicode Strings to Lower Case and Upper Case in C++ -- Giovanni Dicanio

Converting Unicode strings to lower and upper cases should be an easy task to accomplish. Unfortunately, that is not the case with C++. Even the so common approach of iterating "char-by-char" in the input string and invoking std::tolower/toupper is wrong. Let's discuss a possible solution to this problem in this article:

How To Convert Unicode Strings to Lower and Upper Case in C++

by Giovanni Dicanio

From the article:

[...] A possible solution to properly convert Unicode strings to lower and upper cases in Windows C++ code is to use the LCMapStringEx Windows API. This is a low-level C interface API.

I wrapped it in higher-level convenient reusable C++ code, available here on GitHub. I organized that code as a header-only library: you can simply include the library header, and invoke the ToStringLower and ToStringUpper helper functions.

 

What is std::ref? -- Sandor Dargo

SANDOR_DARGO_ROUND.JPGWhen working with C++ standard containers and functions, handling references can sometimes lead to unexpected behavior, particularly with copy semantics. This is where std::ref and std::cref come into play, allowing you to store references in containers and pass them safely to template functions like std::bind or std::thread.

What is std::ref?

by Sandor Dargo

From the article:

Have you heard about std::ref and std::cref? The helper functions that generate objects of type std::reference_wrapper? The answer is probably yes. In that case, this article is probably not for you. But if you haven’t heard about them, or the only usage of std::reference_wrapper you faced was storing references in a vector, then probably it’s worth reading on.

This article is inspired by some failing tests that needed me to use std::ref in order to pass them.

What does reference_wrapper do?

A reference of an object T (T&) is not copy assignable. On the other hand, std::reference_wrapper<T> which emulates T& it both copy-constructible and copy-assignable. It’s even trivially copyable, so copying can take place on a byte level which makes it very efficient.

So when should we use such a wrapper?