Tag: Cpp20

Embracing Trailing Return Types and `auto` Return SAFELY in Modern C++ – Pablo Halpern – CppCon 2022

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

Embracing Trailing Return Types and `auto` Return SAFELY in Modern C++ - Pablo Halpern - CppCon 2022
https://github.com/CppCon/CppCon2022

In the old days (and in C), the return type of a function was specified at the beginning of its prototype, after the storage-class specifiers, if any. Modern C++ adds two additional ways to specify a function's return type, adding convenience, uniformity of expression, and, in some cases, clarity. Trailing return types were introduced in C++11 and have several potential advantages over leading return types, especially for function templates and lambda expressions. Automatically deduced return types go a step further, allowing the programmer to eschew specification of the return type entirely and letting the compiler do all of the work. These features can be used to great advantage when the return type of a function is complex or is best expressed directly as the type of an expression. Used unwisely, though, deduced return types can impede readability, create excessive coupling between the interface and the implementation of a function, and create latent bugs in template code. In this talk, we will cover the syntax and restrictions for these two new features, examine their relationship to each other, explore several use cases for each, and -- most importantly -- probe potential pitfalls when attempting to employ these language features.
---

Pablo Halpern

Pablo Halpern has been cppcon.digital-medium.co.uk/tag/programming/">programming in C++ since 1989 and has been a member of the C++ Standards Committee since 2007. His major contributions to the standard have been in the areas of parallel and vector cppcon.digital-medium.co.uk/tag/programming/">programming constructs as well as on improvements to the usability of memory allocators. Pablo is a major contributor to the book, Embracing Modern C++ Safely by John Lakos and Vittorio Romeo (2021) and is the author of The C++ Standard Library from Scratch (2000). His current development focus is in moving the API of the open-source BDE library in the direction of the C++17 PMR allocator model. He lives with his partner in Boston, MA. When not working on books and allocators, he enjoys model rocketry, hiking, skiing, snowboarding, and watching opera. He has recently started learning Pickleball.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , , , , ,

An Introduction to Multithreading in C++20 – by Anthony Williams – CppCon 2022

https://cppcon.org/
---

An Introduction to Multithreading in C++20 - Anthony Williams - CppCon 2022
https://github.com/CppCon/CppCon2022

Where do you begin when you are writing your first multithreaded program using C++20? Whether you've got an existing single-threaded application, or you're starting from scratch, C++20 provides the basic tools to help. In this talk we'll look at the C++20 facilities you should reach for first, and how to use them safely.
---

Anthony Williams

Anthony Williams’ primary area of expertise is in the development of multi-threaded applications and libraries in C++. Anthony is the author of C++ Concurrency in Action, published by Manning. He is a UK-based developer and trainer with over 20 years of experience in C++.

Anthony has been an active member of the BSI C++ Standards Panel since 2001, and is author or coauthor of many of the C++ Standards Committee papers that led up to the inclusion of the thread library in the C++11 Standard. He continues to work on new facilities to enhance the C++ concurrency toolkit, both with standards proposals, and implementations of those facilities.

Anthony lives in the far west of Cornwall, England, where he currently spends most of his time developing automotive software for Woven Planet.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #multithreading

Filed under: UncategorizedTagged with: , , , ,

Graph Algorithms and Data Structures in C++20 – Phil Ratzloff & Andrew Lumsdaine – CppCon 2022

https://cppcon.org/
---

Graph Algorithms and Data Structures in C++20 - Phil Ratzloff, Andrew Lumsdaine - CppCon 2022
https://github.com/CppCon/CppCon2022

The C++ Standard Library is a valuable collection of generic algorithms and data structures that improves the usability and reliability of C++ software. Graph algorithms and data structures are notably absent from the standard library, and previous attempts to fill this gap have not gained widespread adoption.

This session presents an approach for expressing graph algorithms in a modern, composable, and extensible, aka generic, fashion. Concepts provide a means for a systematic organization of the type requirements for graph algorithms to operate correctly and efficiently. Remarkably, these type requirements can be expressed not in graph-specific terms, but rather in terms of existing sets of requirements already in place for basic containers in C++, i.e., ranges. Using this conceptual framework, we develop several generic algorithms and concrete data structures as well as the emerging proposal for a standard graph library.
---

Phil Ratzloff

Phil Ratzloff is a Distinguished Software Developer and C++ advocate at SAS Institute. He has used C++ for 27 years on applications using graphs for business cost analysis and fraud detection.
---

Andrew Lumsdaine

Andrew Lumsdaine is an internationally recognized expert in the area of high-performance computing who has made important contributions in many of the constitutive areas of HPC, including systems, programming languages, software libraries, and performance modeling. His work in HPC has been motivated by data-driven problems (e.g., large-scale graph analytics), as well as more traditional computational science problems. He has been an active participant in multiple standardization efforts, including the MPI Forum, the BLAS Technical Forum, the ISO C++ standardization committee, the oneAPI Technical Advisory Board, and the SYCL Advisory Panel. Open source software projects resulting from his work include the Matrix Template Library, the Boost Graph Library, and Open MPI.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #algorithms #datastructures

Filed under: UncategorizedTagged with: , , , , , , ,

Using Modern C++ to Eliminate Virtual Functions – Jonathan Gopel – CppCon 2022

https://cppcon.org/
---

Using Modern C++ to Eliminate Virtual Functions - Jonathan Gopel - CppCon 2022
https://github.com/CppCon/CppCon2022

As of C++20, there are no cases in which statically linked programs require virtual functions. This talk will explore techniques for replacing runtime polymorphism with compile-time polymorphism such that virtual functions are never necessary. This talk will also address the higher-order concern of when it might make sense to avoid virtual functions or remove them from a codebase, as that decision ultimately is a design decision that only the author of the code can make. Attendees can expect to come away with a stronger understanding of the purposes of virtual functions and the mechanisms in modern C++ that can now be used to achieve those same purposes.
---

Jonathan Gopel

Jonathan is a C++ enthusiast who likes to tinker with the latest language features. He spends a lot of time thinking about designing beautiful, easy to use APIs, and believes that the hard part is interfacing with the humans, not the machines. In his spare time, Jonathan pursues outdoor sports - especially climbing, skiing, and running.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #functions

Filed under: UncategorizedTagged with: , , , , , , ,

Understanding C++ Coroutines by Example: Generators (Part 1 of 2) – Pavel Novikov – CppCon 2022

https://cppcon.org/
---

Understanding C++ Coroutines by Example: Generators (Part 1 of 2) - Pavel Novikov - CppCon 2022
https://github.com/CppCon/CppCon2022

Coroutines are a powerful tool added to C++20. There are no out-of-the-box facilities in the standard library that are user friendly and immediately usable, although there are plenty of libraries out there already providing such primitives.

Also there are now best practices regarding usage of coroutines in C++ that emerged while people were learning them, and that programmers should know about.

This time we will concentrate on the generators part of the coroutines.
We'll get up to speed with how coroutines work under the hood, and then learn about the co_yield keyword, and how simple generators and asynchronous generators conceptually work.

Note: this session is part 1 of a series of talks. They cover separate aspects of coroutines and are designed to be mostly independent. You can watch part 2 here: https://youtu.be/lz3F036_OvU
---

Pavel Novikov

Got an engineering degree in missilery from BMSTU (Moscow).

Loves C++ and knows how to cook it.

Likes metaprogramming, multithreading and asynchronous programming, coroutine adoption enthusiast.
__

Videos Streamed, Edited, and YouTube Channel Managed by Digital Medium: http://online.digital-medium.co.uk

#cppcon #programming #coroutines

Filed under: UncategorizedTagged with: , , , , , , , ,

Taking Static Type-Safety to the Next Level – Physical Units for Matrices – Daniel Withopf – CppCon 22

https://cppcon.org/
---

Taking Static Type-Safety to the Next Level - Physical Units for Matrices - Daniel Withopf - CppCon 2022
https://github.com/CppCon/CppCon2022

If you are interested in achieving the ultimate goal in library interface design: "If it compiles, it works!", this talk is for you!

There are several existing C++ libraries to annotate scalars with their physical units.

This talk will present a full-blown solution for a related problem that has not been solved in C++ before: How can we put distinct physical unit types (e. g. meters, seconds, meter per second...) inside a single vector or matrix type from a linear algebra library?

The presented solution uses C++'s strong type system to provide these physical unit annotations for each matrix element. Furthermore, it also enables coordinate frame and quantity kind annotations (think X- and Y-position in coordinate frame A or B which have identical units but refer to different things).

We will learn what is the best way to represent these annotations, how they propagate through linear algebra operations, how they determine the subset of valid operations on each type and of course and most importantly, how this can be implemented efficiently in C++ (with a special on how C++20 is a game-changer here).

While developing the solution, we will also understand how this leads to code that is more expressive and less likely to contain errors because the majority of bugs can be caught at compile-time.

Applications that benefit from this include robotics, computer graphics, automated driving and any other domain that works with physical units, different coordinate frames and matrix operations.
---

Daniel Withopf

Daniel Withopf has been working on solving real-world problems with C++ in robotics, computer vision and related fields for over 20 years. He is a Staff Software Engineer at the German car supplier Bosch where he wrote and maintains an object tracking framework for self-driving car projects. While doing that he discovered novel ways how to leverage C++'s type system to create linear algebra and tracking code that is more expressive, easier to understand and less likely to contain errors.
__

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

#cppcon #programming #type

Filed under: UncategorizedTagged with: , , , , , , , , ,

ISO C++ Standards Committee Panel Discussion – Hosted by Herb Sutter – CppCon 2022

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

ISO C++ Standards Committee Panel Discussion - Hosted by Herb Sutter - CppCon 2022

Committee Fireside Chat

Bring your questions! This panel of representative members of the C++ standards committee is ready to discuss everything from C++20 and C++23, to how the committee has been working online for nearly all the C++23 cycle, to what to look forward to in Standard C++ in the coming years.

Besides C++’s creator Bjarne Stroustrup, the panelists include a variety of members from across the topical subgroups in the committee. You’ll have people who participate in language and library evolution, and topics like compile-time cppcon.digital-medium.co.uk/tag/programming/">programming, real-time/embedded systems, AI, and teaching as the community starts to absorb all the new features in C++20 and soon C++23.
---

Moderator: Herb Sutter
---

Panelist: Bjarne Stroustrup
---

Panelist: Daisy Hollman
---

Panelist: Daniela Engert
---

Panelist: David Sankel
---

Panelist: Inbal Levi
---

Panelist: Michael Wong
---

Panelist: Nina Ranns
---

Panelist: Pablo Halpern
---

Panelist: Timur Doumler
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , , , , ,

C++ Lambda Idioms – by Timur Doumler – CppCon 2022

https://cppcon.org/
---

C++ Lambda Idioms - Timur Doumler - CppCon 2022
https://github.com/CppCon/CppCon2022

Ever since they were introduced in C++11, lambdas have been an essential language feature. Each subsequent standard added more functionality: we got generic lambdas and init captures in C++14, constexpr lambdas in C++17, default-construction and assignment, explicit template arguments and more in C++20, and even more possibilities are coming in the upcoming C++23 standard.

In this talk, we are looking at various interesting things you can do with lambdas. Some of these are well-established, useful idioms; others are lesser known, surprising tricks. Have you ever inherited from a lambda? Can you think of three different ways to call a lambda recursively? Do you know what happens if we assign an immediately-invoked lambda expression to a static variable? If not, then this talk is for you.
---

Timur Doumler

Timur Doumler is the Developer Advocate for C++ tools at JetBrains and an active member of the ISO C++ standard committee. As a developer, he worked many years in the audio and music technology industry and co-founded the music tech startup Cradle. Timur is passionate about building inclusive communities, clean code, good tools, low latency, and the evolution of the C++ language.
__

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #lambda

Filed under: UncategorizedTagged with: , , , , , ,

Using Incredibuild to Accelerate Static Code Analysis and Builds – Jonathan “Beau” Peck CppCon 2022

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

Going Beyond Build Distribution: Using Incredibuild to Accelerate Static Code Analysis and Builds - Jonathan "Beau" Peck - CppCon 2022
https://github.com/CppCon/CppCon2022

Even though C++ compilation times seem to be trending downward, the introduction of modules in C++20 means that long compile times might remain a stress factor for developers. This is before accounting for the time it takes to complete tasks like static code analysis which adds more time to the C++ CI pipeline.

This session will demonstrate how to better manage your CI pipeline to achieve faster and more frequent iterations, improve developer velocity and software quality while adding static code analysis to your dev cycle. We will see how to connect your CI pipeline to Github Actions to achieve automatic triggered CI processes and how to distribute those to on-prem machines or to the cloud with Incredibuild.
---

Jonathan "Beau" Peck

Beau's first computer command was LOAD "*",8,1 on a blue screen which at that time was something you wanted to see. But he really discovered technology while working as a flight control officer when he realized running aircraft operations was in many ways like running ones and zeros (if you're curious feel free to ask him). Thanks to Linux, his natural curiosity about breaking things apart to understand how they worked and then learning and discovering new ways to put things together led him into a career spanning 20++ (I see what you did there) years across systems administration, systems engineering, database and architecture.

His passion is helping customers align, create, architect and operate technical solutions that solve business and technical needs. Currently he is a solutions architect with Incredibuild focused on helping developers accelerate build and test times with distributed computing processing and process virtualization.
__

Avi Lachmish

Avi is an expert in Web and networking technologies, operating systems, and software development methodologies. Avi has extensive experience in C++, object-oriented analysis, design and distributed architectures.
---

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , , ,

Functional Composable Operations with Unix-Style Pipes in C++ – Ankur Satle – CppCon 2022

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

Functional Composable Operations with Unix-Style Pipes in C++ - Ankur Satle - CppCon 2022
https://github.com/CppCon/CppCon2022

Let's write C++ code like this shaking off all the verbosity and with 100% domain code and ~0% syntax! Do we really need to explicitly state whether a function is a continuation or a transform?

return get_env("KafkaConsumerConfigFile")
| get_file_contents
| make_client
| connect
| subscribe;
Unix commands seamlessly compose, piping into each other to form a clear train of operations in one line! Similarly in C++, we moved away from non-composable, multi-step processing of ranges using algorithm. We embraced the composable ranges using pipes. This reduced time & space complexity, improved performance, provided clarity & reduced cognitive load when working with ranges.

But, when NOT dealing with std::ranges, can one work with such easy composability? Why not pipe operations to work with application/business entities! YES, of course, I say! Let's pipe application logic operations & get declarative! HOW HARD COULD IT BE!

With just C++11, we achieve piping operations for any generic T & a Callable. We address Error handling, Resource management, Customizations and Variations like chaining functions taking more than 1 argument or invoking a member function operation instead of free function. Supporting C++20, we make sure our pipe implementation does NOT interfere with std::ranges operations.

Finally, we address the proposed C++23 Monadic interface functions (and_then, transform, or_else) of std::optional and present how we can implement the same without having to explicitly state the verbose and_then, transform, or_else to work with optional. We encounter a surprise on the way & correct overload resolution by employing a concept.

We also discuss critique & compromises of this approach.
---

Ankur Satle

Ankur is an avid (natural) language learner, but C++ is his mother tongue!
His mantra is: "Effective, Efficient & Elegant". He leverages the power of the small to build large-scale systems. As Smart Data Platform Architect at EXFO, he builds High-performance, Scalable, Telecom Products for 4G/5G Core. He loves working in constrained environments.
He was the Organizer & Host of CppIndiaCon, since inception. His dream came true when he hosted the AMA with Bjarne Stroustrup!
He is the Core Organizer at CppIndia, India's C++ User Group, the most active C++ user group.
He has presented at CppCon 2020 & CppCon 2021, CppIndiaCon 2021 & CppIndiaCon 2022
__

Videos Streamed, Edited, and YouTube Channel Managed by Digital Medium: http://online.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , , , ,