Loading…
C++Now 2021 has ended

Log in to bookmark your favorites and sync them to your phone or calendar.

Sunday, May 2
 

11:00am MDT

Pre-Conference Open House
Kick off the conference right at the Pre-Conference Open House.
Get acquainted with new friends and reacquainted with old friends.
Verify that you are properly configured to fully enjoy the Main Program sessions starting on Monday.
We'll have panels, puzzles, games, “best of” lightning talks, and meeting speakers, Boost Library authors, other conference attendees.

Sunday May 2, 2021 11:00am - 1:00pm MDT
GatherTown Virtual Expo
 
Monday, May 3
 

8:00am MDT

Library in a Week: Boosting Boost
This session will be held in the Gather Town Library in a Week room with Zoom as a Backup

In this year's Library in a Week we will turn our focus back to where this all started: Boost. The success, longevity, and number of libraries in Boost has created its own issue: maintenance. With std C++ now shipping every three years instead of every fifteen, it's tricky to keep everything current. The community maintenance team can always use additional hands and brains to solve both big and little issues.

In this session I'll outline what Library in a Week (LIAW) is all about, how we will attempt to work (all virtual is a new paradigm). LIAW is a workshop that continues for the length of the conference and is run by the participants. We typically have daily short presentations from people working on problems and coordination sessions during lunch and dinner. Since we're not in Aspen walking to lunch and dinner we'll be using GatherTown as the forum for this collaboration. In the 'Library' you'll find we have a dedicated room for making presentations and having discussions.


Speakers
avatar for Jeff Garland

Jeff Garland

CrystalClear Software
Jeff Garland has worked on many large-scale, distributed software projects over the past 30+ years. The systems span many different domains including telephone switching, industrial process control, satellite ground control, ip-based communications, and financial systems. He has written... Read More →


Monday May 3, 2021 8:00am - 8:30am MDT
GatherTown Virtual Expo

8:45am MDT

CMake: One Tool To Build Them All
Originally developed as part of the National Institutes of Health (NIH) open source medical segmentation and registration toolkit ITK in 1999, CMake has grown to take on a vital role in the C++ ecosystem. Bill Hoffman, a founder of Kitware (www.kitware.com), and the creator of CMake will talk about how CMake fits into the C++ world. This talk will describe how CMake is more than just a build system, but a tool chain that transforms C, C++, Fortran, CUDA, and C# code into a final, shippable product.

The heart of CMake is the codification of the complex knowledge between the C, C++, and Fortran language standards, and the diversity of available compilers, linkers, archivers, packagers, run-time loaders, and operating systems. CMake's ability to encode translation and artifact unit dependencies, manage language levels and compiler parameters via usage requirements, and support the mixing of multiple languages seamlessly are all designed to support the driving purpose of CMake: "to build software everywhere, correctly, with the user’s preferred tools.”

Once a project is correctly built, there is still work to be done to test and package the project. CMake provides a single cross platform process to install, package and test C++ software. With its open source development and large developer and user community, CMake is able to adapt to new tools and compilers quickly. Continuous testing on all supported platforms and a quarterly release cycle provide new features that are both stable and quick. CMake has a strong commitment to backwards compatibility assuring its user base that future versions will continue to build software into the future.

In summary, this talk will give the history behind CMake and explain how it fits into the areas not specified by the C++ standard, enabling developers to take advantage of the rich C++ ecosystem. The talk will introduce users to important CMake features supporting the seamless building, testing and deployment of C++ across most computing platforms.

Speakers
avatar for Bill Hoffman

Bill Hoffman

Kitware
Mr. Hoffman is a founder of Kitware and currently serves as Chairman of the Board, Vice President, and Chief Technical Officer (CTO). He is the original author and lead architect of CMake, an open source, cross-platform build and configuration tool that is used by hundreds of projects... Read More →


Monday May 3, 2021 8:45am - 10:30am MDT
A

11:30am MDT

The C++ Rvalue Lifetime Disaster
Rvalue references have been with us since C++11. They have originally been introduced to make moving objects more efficient: the object an rvalue reference references is assumed to go out of scope soon and thus may have its resources scavenged without harm. The C++ standard library, for example std::cref or std::ranges, makes use of yet another aspect of rvalue references: since they go out of scope soon, it is assumed unsafe to hold on to them beyond the scope of the current function, while lvalue references are considered safe. We, too, found this assumption to be very useful for smart memory management, in particular in generic code.

Unfortunately, the C++ language itself violates this assumption in at least two places. First, rvalues bind to const&. This means that innocent-looking functions taking a parameter by const& and passing it through in some way silently convert rvalues to lvalue references, hiding any lifetime limitation of the rvalues. std::min/max are two such examples. Worse still, every accessor member function returning a const& to a member suffers from this problem. Second, temporary lifetime extension is meant to make binding a temporary to a reference safe by extending the lifetime of the temporary. But this only works as long as the temporary is still a prvalue. If the temporary has been passed through a function, even it has been correctly passed through by rvalue reference, lifetime extension will no longer be invoked and we get a dangling reference.

These problems are not merely theoretical. We have had hard-to-find memory corruption in our code because of these problems. In this talk, I will describe the problems in detail, present our library-only approach to mitigate the problems, and finally, make an impossible-to-ever-get-into-the-standard proposal of how to put things right.

Speakers
avatar for Arno Schödl

Arno Schödl

Founder &CTO, think-cell
Founder & CTOArno is responsible for the design, architecture and development of all our software products. He oversees think-cell's R&D team, Quality Assurance and Customer Care.Before founding think-cell, Arno worked at Microsoft Research and McKinsey. Arno studied computer science... Read More →


Monday May 3, 2021 11:30am - 1:00pm MDT
B

11:30am MDT

A Crash Course in Unicode for C++ Developers
C++ is starting to make Unicode easier to use, although it does not, yet, have standard APIs for processing Unicode text. There are a number of concepts that Unicode introduces that are important for being able to use Unicode correctly, and the concepts build on each other. This talk will give you a crash course so you can understand how Unicode encodings work, what code units, code points, and grapheme clusters are, decode and encode algorithms into and out of Unicode text, what Unicode normalization does and what the various forms are for, and what the various Unicode algorithms for text processing are. This will give you the tools to understand how not to break your user's text, at least not too much or often.

Speakers
avatar for Steve Downey

Steve Downey

Bloomberg LP


Monday May 3, 2021 11:30am - 1:00pm MDT
A

11:30am MDT

Transpose(*this) - An Update on the State of Linear Algebra for Standard C++
A remarkable amount of progress has been made over the last 18 months towards the goal of bringing linear algebra to the standard C++ library. This talk will provide an update on those efforts, as well as provide some examples of how many of the proposed facilities could be used.

We'll begin with a very quick refresher on what linear algebra is, why it's so important in our modern world, and why linear algebra should be part of the standard library. Next, we'll summarize some important proposals that support the linear algebra effort and describe some of their capabilities and roles. Finally, we'll dive into several examples to see how these proposed facilities allows us to specify an interface that is intuitive, expressive, and supports fine-grained customization for those in search of higher performance.

Speakers
avatar for Bob Steagall

Bob Steagall

Chief Cook and Bottle Washer, KEWB Computing


Monday May 3, 2021 11:30am - 1:00pm MDT
C
  • Type Design

1:30pm MDT

When Should You Give Two Things the Same Name?
C++ gives us many opportunities to name two things the same. Two functions can have the same name if they have different signatures; two members can have the same name if they're in different classes; two entities can have the same name if they're in different namespaces. C++ also gives us a handful of tools to exploit same-named-ness: virtual functions and dynamic dispatch, overload resolution, templates, concepts, and (to a lesser extent) macros, typedefs, and namespace aliases. In this philosophical talk replete with cherry-picked examples, I contend that we should give two entities the same name if and only if we intend to manipulate them with one of these tools.

Speakers
avatar for Arthur O'Dwyer

Arthur O'Dwyer

C++ Trainer
Arthur O'Dwyer is the author of "Mastering the C++17 STL" (Packt 2017) and of professional training courses such as "Intro to C++," "Classic STL: Algorithms, Containers, Iterators," and "The STL From Scratch." (Ask me about training your new hires!) Arthur is occasionally active on... Read More →


Monday May 3, 2021 1:30pm - 3:00pm MDT
B

1:30pm MDT

C++11/14 at Scale: What Have We Learned?
Many years have passed since the release of C++11 and C++14. These standards brought many new features and idioms to the C++ language and revitalized its community. Nowadays, with C++20 having one foot out the door, it is important to look back at the experience gained using C++11/14 at scale and re-evaluate their impact. - What have we learned from 8 years of using Modern C++ in production at a large-scale corporation? - What features were the most useful? - Which ones were the most misused? From unexpected benefits/drawbacks to teachability issues, this talk will discuss the most significant consequences of embracing C++11 and C++14 in a company with thousands of engineers. With some *healthy* skepticism, commonly used features and idioms will be reassessed to uncover some unexpected pitfalls or qualities.

Speakers
avatar for John Lakos

John Lakos

Software Engineer, Bloomberg
John Lakos, author of Large-Scale C++ Software Design [Addison-Wesley, 1996], serves at Bloomberg LP in New York City as a senior architect and mentor for C++ software development worldwide.  He is also an active voting member of the C++ Standards Committee’s Evolution Working... Read More →
avatar for Vittorio Romeo

Vittorio Romeo

Software Engineer, Bloomberg
Vittorio Romeo (B.Sc. Computer Science) has been a Software Engineer at Bloomberg for more than 3 years, working on mission-critical company C++ infrastructure and providing Modern C++ training to hundreds of fellow employees.He began programming around the age of 8 and quickly became... Read More →


Monday May 3, 2021 1:30pm - 3:00pm MDT
C

1:30pm MDT

How to: Colony
This talk will cover the nuts and bolts of colony, a bucket-array-like container currently in the process of standardisation.

The intent is to pass on knowledge, so that in my absence others can make their own, hopefully optimal, implementations, now or in the future. In addition it might give some ideas to those implementing entirely different containers.

There will be no broad overview with the exception of a brief explanation at the beginning, and instead we'll be diving deep into the mechanics.

For those new to the Colony container, my CppCon 2016 talk, "Colonies, performance and why you should care" is recommended (though outdated).

Speakers
avatar for Matthew Bentley

Matthew Bentley

Computer Engineer
Matt Bentley was born in 1978 and never recovered from the experience. He started programming in 1986, completing a BSc Computer Science 1999, before spending three years working for a legal publishing firm, getting chronic fatigue syndrone, quitting, building a music studio, recovering... Read More →


Monday May 3, 2021 1:30pm - 3:00pm MDT
A
 
Tuesday, May 4
 

7:00am MDT

Better C++ Ranges
Ranges have been in the C++ standard for while now, and find their way into modern codebases. At think-cell, we have been developing and using our own range library for 20 years, which is built on top of the standard and is compatible with it, but goes beyond it in many aspects.
 
Range adaptors are often stacked, a filter on top of a transform on top of etc. To make such a stack efficient, iterators are not good enough. We use a new concept that is more efficient and at the same time compatible with iterators so library users can keep using iterators as before.
 
The standard library is very strict about the distinction between containers and views, and range adaptors are views which must maintain a reference to the data being adapted. Instead, we allow range adaptors to hold data themselves to make them self-contained and lazily evaluated at the same time.
 
The standard iterator model only allows external iteration. However, internal iteration is often much easier to implement than external iteration. For many applications, internal iteration is completely adequate and more efficient than external iteration. Therefore, we bring internal iteration into the range family, to the point that the library user may not know or care which kind of iteration is being used.
 
Standard algorithms return iterations and use the end iterator to signal some singleton state. By customizing return values, we can make our code more terse and expressive, for example eliminating these dreaded iterator end checks.
 
These features combined make ranges an excellent tool for text formatting. We can use these ranges to represent the values to be formatted, conceptually turning them into lazily evaluated strings. These can be used just like regular strings are used today: in function returns; as standard algorithm input; embedded into other, equally lazily evaluated strings; and so on, before they are finally expanded for display. By choosing the right interfaces, we can optimize this expansion at compile-time, allowing both nice syntax and a performance which is very close to manually optimized code.

Speakers
avatar for Arno Schödl

Arno Schödl

Founder &CTO, think-cell
Founder & CTOArno is responsible for the design, architecture and development of all our software products. He oversees think-cell's R&D team, Quality Assurance and Customer Care.Before founding think-cell, Arno worked at Microsoft Research and McKinsey. Arno studied computer science... Read More →


Tuesday May 4, 2021 7:00am - 8:30am MDT
C

7:00am MDT

Converting a State Machine to a C++ 20 Coroutine
C++ 20 coroutines can naturally express in linear code components that are today written as state machines that wait on async operations. This talk walks through using the low-level machinery and customization points in C++ 20 to convert a state machine, which waits at the end of steps for async service operations to complete, into a single coroutine that `co_awaits` those operations.

Speakers
avatar for Steve Downey

Steve Downey

Bloomberg LP


Tuesday May 4, 2021 7:00am - 8:30am MDT
B

7:00am MDT

Code Analysis++
Martin Fowler once wrote that high-quality software is actually cheaper to produce than low-quality software. We agree with that sentiment, and we warmly welcomed the C++ Core Guidelines when they were introduced in 2015. Research and surveys conducted in the C++ Community consistently demonstrate the popularity of the Clang family of tools, as well as the growing demand for static analysis to be added to code editors.

In this talk, we’ll explore the current capabilities of existing C++ static analyzers and discuss some of the enforcements listed in the C++ Core Guidelines from a toolability aspect. We’ll also look into the recent “Simplify C++” trend in the language’s evolution, and to wrap things up we’ll take a look at how technology-specific analysis (like MISRA and AUTOSAR) is being adopted.

A variety of checks will be discussed, from catching a dangling pointer to conforming to the preferred code style and naming scheme. And I want to share a crazy idea I have about gamifying static analysis. Let’s play!

Speakers
avatar for Anastasia Kazakova

Anastasia Kazakova

PMM, JetBrains


Tuesday May 4, 2021 7:00am - 8:30am MDT
A

9:00am MDT

Practical TMP: A C++17 Compile Time Register Machine
C++ compile time programming is Turing complete.

This fact has been well known since the early days of template meta programming, but how far can this knowledge be taken in practical terms? Is it performant? Can it help with writing actual code?

In this session I intend to demonstrate that not only is a compile time register machine theoretically possible, but with a bit of care and consideration it is also quite practical. If you'd like learn about the aspects of design that allow for such a "meta" language, as well as some considerations toward real world applications, this talk is for you.

Speakers
avatar for Daniel Nikpayuk

Daniel Nikpayuk

Daniel Nikpayuk
Daniel is an independent coder/designer with a background in math. He is an Inuvialuk person currently residing in Edmonton, AB, Canada. He is building a programming language to assist in modern forms of Indigenous multimedia and storytelling.  @Daniel_Nikpayuk 


Tuesday May 4, 2021 9:00am - 9:45am MDT
B

9:00am MDT

Surveying the C++ community
Presenting Numbers, Data and Facts about the C++ Community.

In 2020 Meeting C++ launched a continuous survey about the C++ community, this talk will present some of the details and findings out of the first year of running such a survey tool for the C++ community.
The talk will take a quick look on the other surveys from ISOCPP and Jetbrains and explain the difference to these annual surveys. It will feature a dive into some of the results of the so far collected data and show what we can learn from its combinations. The talk will feature results for 2020 and the current results of the continuous survey.

Speakers
avatar for Jens Weller

Jens Weller

Meeting C++ / Community Organizer, Meetingcpp GmbH
Jens Weller has worked, since 2007, as a freelancer in C++, specialising in consulting, training and programming C++. He started with programming C++ back in 1998. He is an active member of the European C++ community and the founder of the Meeting C++ platform and conference. Jens... Read More →


Tuesday May 4, 2021 9:00am - 9:45am MDT
A

9:00am MDT

Interactive C++ in a Jupyter Notebook Using Modules for Incremental Compilation
Cling was the first interactive environment for C++. While it is an amazing piece of technology, it has several notable deficiencies, e.g. the loss of all previous work when a segfault occurs. In this talk, I discuss how modules can be used to perform incremental compilation in a fashion similar to what is available in Cling. The basic concept is that each cell of a notebook exports itself as a module which the following cell imports, forming a computational chain. The talk will consist of a demo on a notebook that is run from a Docker image. Interested participants will be able to download this image and experiment with the notebook.

Speakers
avatar for Steven R. Brandt

Steven R. Brandt

Assistant Director, Computational Science, Louisiana State University


Tuesday May 4, 2021 9:00am - 9:45am MDT
C
  • Tools

9:50am MDT

Executors: The Art of Generating Composable APIs
With the ever-increasing count on the number of processors in the High-Performance Computing market, we inevitably hit the mark where the probability of Silent Data Corruptions (SDC), i.e., errors arising from unexpected aberrations in data or compute, are high. With higher possibilities, a cope-up mechanism, i.e., software resilience, is required to mitigate the situation. Software resilience for task-based runtimes can be achieved through either replay or replication of a task, i.e., to essentially try executing the task until you get the desired output. This talk takes the audience through the design decisions, implementation details, and key takeaways that led to implementing the resiliency module within HPX, the C++ Standard Library for Concurrency and Parallelism. HPX is a standard-conforming library that implements standard C++ algorithms and adds on various other features that are yet to exist in the standards, for instance, executors and parallel range-based algorithms.

This talk first introduces the user to local and distributed software resilience and new standards conforming APIs that integrate with existing HPX APIs. It then extends to using proposed C++ executors that takes a base executor and generates a resilient executor. The resilient executor can be supplied to hpx::async to observe resilient async execution. Furthermore, it shows how different resiliency module components can be composed together to produce the desired effect. The speaker then introduces customization point objects (CPOs) and their use to dispatch to the correct API overload. It is useful due to the recent integration with Kokkos executors where kernels run on a GPU, allowing us to specialize an implementation for Kokkos executors while relying on CPOs to identify the correct implementation.

The talk ends with some results that describe the overheads of such abstractions (spoiler alert: they are negligible). People interested in designing composable modules to build more powerful constructs are encouraged to attend the talk. HPX executor architecture, built upon the executor proposal - p0443r4, is also discussed in detail.

Speakers
avatar for Nikunj Gupta

Nikunj Gupta

HPX Open-Source Contributor, STE||AR Group
Nikunj is the author of resiliency modules and the adapted hpx_main framework in HPX - a C++ Standards library for Parallelization and Concurrency. He's currently working on extending the resiliency modules and designing executors within HPX.


Tuesday May 4, 2021 9:50am - 10:35am MDT
B

9:50am MDT

Parallelism on Ranges: Should We?
Ranges have recently been introduced to the realm of C++ Standard. While the initiating idea was to increase the level of abstraction provided for the C++ Standard algorithms, it quickly evolved into a mechanism where users could code complex sequences of algorithms in an expressive and readable way. On the other hand, since C++17, when calling a C++ STL algorithm, the user is allowed to pass an execution policy as their first argument in order to control parallelization options. That enables the algorithm to run with vectorization optimizations or/and in parallel . It’s crucial to note though, that the execution policy option can only be used on the non-ranges overloads (namely, the iterator based ones), as ranges have been added in C++20 only. Therefore, the problem that emerges from the utilization of ranges, is the following: should the community push forward in order to embed the execution policy mechanism on the range based algorithms?
This talk is concentrated on providing insight on how the ranges could be parallelized and the possibilities that arise from such a powerful concept. Given that ranges are designed in order to support pipelining, trying to parallelize that kind of sequenties could potentially produce hundreds of subcases where algorithmic fusion would have to take place for every single combination. HPX, which is a C++ Standard Library for Concurrency and Parallelism, has taken serious steps in order to provide actual implementation proposals on how the machinery behind that could possibly work. The speaker provides the general algorithmic picture behind range parallelization, along with presenting tangible examples for candidate implementations.

Speakers
avatar for Giannis Gonidelis

Giannis Gonidelis

HPX Open-Source Contributor, STE||AR Group
Giannis is an open source contributor on HPX, a C++ Standards library for Parallelization and Concurrency. He is mainly working on parallelization methods and algorithms. He is currently involved in adapting HPX to C++20.


Tuesday May 4, 2021 9:50am - 10:35am MDT
C

9:50am MDT

Weak Interfaces → Weak Defences: The Bane of Implicit Conversion in our Function Calls
Making functions that can be called just the right way is trickier than it sounds.
It is way too easy to simply use only the built-in and some of the cornerstone STL types as parameters to the function.
People commonly go about taking ints, and bools, and doubles, and strings.
What actual semantics are tied to individual parameters are usually expressed through the name of the variable, or worse, only in the documentation.
Special tools outside of the language's jurisdiction are needed to handle these names.
And we all know people rarely like to read the documentation...

However, the situation is even worse than it would seem at face value: given a function like "drawBlameView(FileID, int, int, bool, DrawMode)" you would think only the two ints are the problem...
Wrong! All 5 parameters here might be mixed up, due to typedefs hiding FileID to be actually int, and the implicit conversion between bool and the rest.
Unfortunately, this is not immediately apparent, especially when a new person joins an existing project, and the responsibility falls to all of us to make sure our function interfaces are safer.

Several tools exist that try string magic to figure out whether a call is done with badly ordered arguments by mistake.
However, those tools mostly can only help after the fact.
We will discuss how one can go about finding and filtering out the functions in their project.
What's more, a highlight and plea for preventive refactoring also help in identifying places in the code where type safety will not only help function calls but other parts too, such as your local variables.
The method might sound simple at first, but there are plenty nasty creatures lurking in the shadows... especially if you want to do all this for an incredibly huge project that has never evolved to proper type safety.

Speakers
avatar for Richárd Szalay

Richárd Szalay

PhD Student, Eötvös Loránd University, Faculty of Informatics, Department of Programming Languages and Compilers
Richárd has been developing in C++ for around a decade at this point (with occasional breaks to pursue other projects mainly in C# and Python) and has been developing *for* C++ in the past 6 years. He is currently a PhD student researcher, working at Ericsson Telecommunication Technologies... Read More →


Tuesday May 4, 2021 9:50am - 10:35am MDT
A

11:30am MDT

Using Concepts: C++ Design in a Concept World (part 1 of 2)
In c++20 concepts have finally arrived. Despite long precedence for concepts via meta-programming in c++, concepts brings new facilities to the table. With implementations in compilers and standard library support we now need to step back and consider how to apply this new tool in real projects. How can we use standard library concepts for daily coding? How do we write concepts? How do we design libraries and frameworks with concepts?

This tutorial will climb up the concepts ladder: what's a concept, using concepts in code, reading concepts, writing concepts, and finally designing with concepts.  First we'll cover the basics of concepts, the concept and requires keywords. Then we'll explore the application of concepts from a library user point of view. Including as a variable declaration, return values, and function parameters. We look at Then we'll survey and apply c++20 standard library concepts to typical development of a typical c++ class.
Next the tutorial will dig into writing concepts. Taking a step by step approach we look at the details of concept definitions.  Refactoring std::sleep_for using concepts expand to types outside of std::chrono lets us zero in on concepts design alternatives for functions. And the creation of an interval concept provides an example of designing a library with multiple types using concepts.

Finally, we'll tie our new knowledge and look at some ways concepts can impact c++ designs.  We'll look back on what design is and the tools concepts bring.  How do concepts fit in with a multi-paradigm design world.  How do they compare to design principles like Liskov substitution that we currenlty use. Finally, we'll look at the serialization design pattern and see how concepts impact the tradeoffs involved.

Speakers
avatar for Jeff Garland

Jeff Garland

CrystalClear Software
Jeff Garland has worked on many large-scale, distributed software projects over the past 30+ years. The systems span many different domains including telephone switching, industrial process control, satellite ground control, ip-based communications, and financial systems. He has written... Read More →


Tuesday May 4, 2021 11:30am - 1:00pm MDT
C

11:30am MDT

The Worst Best Practices
Whatever you've heard about writing a book, things have changed a lot in recent years. Self publishing is easier than ever, and that brings both good and bad things. We will take look at writing and self publishing a C++ book on best practices in the 2020's; inviting and handling criticism; and the most controversial topics covered in the book, C++ Best Practices.

Speakers
avatar for Jason Turner

Jason Turner

Owner, Jason Turner
Jason is host of the YouTube channel C++Weekly, co-host emeritus of the podcast CppCast, author of C++ Best Practices, and author of the first casual puzzle books designed to teach C++ fundamentals while having fun!


Tuesday May 4, 2021 11:30am - 1:00pm MDT
A

11:30am MDT

hop: A Language to Design Function-Overload-Sets
This talk will present a template-library with a DSEL to create complex function-overload-sets.
If you ever wanted to define
- homogeneous variadic functions-overloads
- variadic functions-overloads with trailing default arguments
- or even variadic functions-overloads with non-trailing default arguments
or you still use the preprocessor to create function-overloads - then you should come!

Speakers

Tuesday May 4, 2021 11:30am - 1:00pm MDT
B

1:30pm MDT

Using Concepts: C++ Design in a Concept World (part 2 of 2)
The second 1/2 of a two part talk -- more focused on the writing of concepts and the design aspects.

In c++20 concepts have finally arrived. Despite long precedence for concepts via meta-programming in c++, concepts brings new facilities to the table. With implementations in compilers and standard library support we now need to step back and consider how to apply this new tool in real projects. How can we use standard library concepts for daily coding? How do we write concepts? How do we design libraries and frameworks with concepts?
This tutorial will climb up the concepts ladder: what's a concept, using concepts in code, reading concepts, writing concepts, and finally designing with concepts.  First we'll cover the basics of concepts, the concept and requires keywords. Then we'll explore the application of concepts from a library user point of view. Including as a variable declaration, return values, and function parameters. We look at Then we'll survey and apply c++20 standard library concepts to typical development of a typical c++ class.
Next the tutorial will dig into writing concepts. Taking a step by step approach we look at the details of concept definitions.  Refactoring std::sleep_for using concepts expand to types outside of std::chrono lets us zero in on concepts design alternatives for functions. And the creation of an interval concept provides an example of designing a library with multiple types using concepts.

Finally, we'll tie our new knowledge and look at some ways concepts can impact c++ designs.  We'll look back on what design is and the tools concepts bring.  How do concepts fit in with a multi-paradigm design world.  How do they compare to design principles like Liskov substitution that we currenlty use. Finally, we'll look at the serialization design pattern and see how concepts impact the tradeoffs involved.

Speakers
avatar for Jeff Garland

Jeff Garland

CrystalClear Software
Jeff Garland has worked on many large-scale, distributed software projects over the past 30+ years. The systems span many different domains including telephone switching, industrial process control, satellite ground control, ip-based communications, and financial systems. He has written... Read More →


Tuesday May 4, 2021 1:30pm - 3:00pm MDT
C

1:30pm MDT

What is an ABI and Why is Breaking it a Problem?
Occasionally, someone will toss out in discussion “That’s an ABI breaking change”. What does that mean? Is that a problem? In this talk, I’ll walk though what an ABI is, talk (a lot) about the "one definition rule", and give examples, and the a definition of an "ABI break”. I’ll talk about history (libstdc++ and string, and others), and talk about some things that the C++ committee is considering.

Speakers

Tuesday May 4, 2021 1:30pm - 3:00pm MDT
A

1:30pm MDT

The Complete Guide to `return x;`
Join Arthur O'Dwyer on a deep dive into Return Value Optimization, implicit move, and related topics. We'll start with an explanation of the calling convention on a typical machine, showing where the mysterious "return slot" lives, and why it makes sense that C++03 allowed copy elision in certain special cases (but not others). Then we'll show how C++11 (and a subsequent defect report) upped the game by quietly turning the remaining copies into moves, so that the received wisdom these days is that `return std::move(x)` is never necessary and often a pessimization (because it disables RVO). However, even in C++17, `return x` would sometimes quietly copy a large object instead of moving it. C++20 adopted Arthur's P1155 "More Implicit Moves," which means that many of these cases have been fixed. Arthur will show one or two cases that remain troublesome.
Furthermore, C++20 adopted David Stone's P0527 "Implicitly move from rvalue references." This paper is a core-language game-changer: it permits `return x` to move out of the target of `x` when `x` is an rvalue reference. We'll show how this surprising new feature of C++20 can be used in the "perfect returning idiom." ...Or can it? We'll review various late-breaking issues surrounding implicit move and the solutions proposed in Arthur's P2266 "Simpler Implicit Move."

Speakers
avatar for Arthur O'Dwyer

Arthur O'Dwyer

C++ Trainer
Arthur O'Dwyer is the author of "Mastering the C++17 STL" (Packt 2017) and of professional training courses such as "Intro to C++," "Classic STL: Algorithms, Containers, Iterators," and "The STL From Scratch." (Ask me about training your new hires!) Arthur is occasionally active on... Read More →


Tuesday May 4, 2021 1:30pm - 3:00pm MDT
B

3:30pm MDT

Lightning Talks
Lightning talks are 5 minute talks on something of interest to C++ programmers. Presentation is open to any C++Now attendee, including Student/Volunteers.

Have a favorite technique or library to share? Employed some C++ feature in a project with amazing/horrible results? Want to start a conversation on Boost 3.0? Submit your proposal for a 5 or 10-minute talk to Michael at lightning@cppnow.org. Be sure to include a title, 3-sentence abstract, and something about yourself.

Come to be amused, enlightened, outraged, or inspired!

Moderators
avatar for Michael Caisse

Michael Caisse

Ciere, Inc.
Michael Caisse started using C++ with embedded systems over 30 years ago. He continues to be passionate about combining his degree in Electrical Engineering with elegant software solutions and is always excited to share his discoveries with others.Michael works for Ciere Consulting... Read More →

Tuesday May 4, 2021 3:30pm - 4:30pm MDT
A
 
Wednesday, May 5
 

7:00am MDT

The Concepts of concepts
In this talk, you are going to learn about one of the flagship features of C++20, concepts. We are going to discover together the main motivations behind concepts, why templates as-is are not enough and how concepts came to the rescue. Then we are going into details into the 4 different ways we can use a concept and the pros and cons for each way. Obviously, this session would be delusional without learning how to write our own concepts, so we're going to spend around half of the session writing new concepts.

Speakers
avatar for Sandor Dargo

Sandor Dargo

Software Developer, Amadeus
Sandor is a passionate software developer focusing on reducing the maintenance costs by developing, applying and enforcing clean code standards. His other core activity is knowledge sharing both oral and written, within and outside of his employer. When not reading or writing, he... Read More →


Wednesday May 5, 2021 7:00am - 8:30am MDT
A

7:00am MDT

The Performance Price of Dynamic Memory in C++
Everyone uses dynamic memory in C++, but what is the performance cost that we are paying which we might be unaware of?

In this lecture we will talk about the performance aspects of using dynamic memory, more specifically:
* Allocating and deallocating memory: programs allocating and deallocating many objects can experience slowness because of memory allocation and deallocation.
* Memory access speed: sometimes, the bottleneck is related to how we arrange data in memory or the memory access pattern.

We will provide information on the reasons why the usage of dynamic memory is slow with examples and propose solutions or workaround to make it faster.

Speakers
avatar for Ivica Bogosavljevic

Ivica Bogosavljevic

Application Performance Consultant, Johny's Software Lab LLC
Ivica is an Application Performance Specialist working in the industry for 10 years. His professional focus is application performance improvement - techniques used to make your C/C++ program run faster by using better algorithms, better exploiting the underlying hardware, and better... Read More →


Wednesday May 5, 2021 7:00am - 8:30am MDT
C

7:00am MDT

Preconditions, Postconditions, Invariants: How They Help Write Robust Programs
This is going to be a high-level overview of certain notions related to program correctness: (a) function contract, (b) precondition, (c) postcondition, (d) invariant.
Even if you are not familiar with these terms you are probably using them already, as they are key to writing correct programs.

In this talk we will see:
1. How thinking in these terms helps us write code more consciously and with fewer bugs.
2. How these terms are reflected today in code (spoiler: comments, assert() and "contract-encoding" types).
3. How different tools, like static analyzers or IDEs, can be improved if things like preconditions can be expressed directly in code.
4. What the difference is between a bug and a symptom of a bug, and how to fix bugs rather than conceal their symptoms.

No prior knowledge of the subject is assumed. By the end of the talk:
1. You will appreciate and be willing to apply the Design by Contract methodology, even if it means putting more asserts() and comments in your code.
2. You should be able to tell why a "contract" is not a sum of preconditions, postconditions and invariants.
3. You will understand how "contract-encoding" types and preconditions/invariants are complementary features.

Speakers
avatar for Andrzej Krzemieński

Andrzej Krzemieński

Principal Software Engineering, Sabre Polska
Andrzej is a software developer since 2004. He works mostly with C++ in commercial software, which includes safety-related and high-performance systems. He is a member of the C++ Standards Committee and a Boost developer. He is also a co-organizer of C++ User Group Krakow. Known to... Read More →


Wednesday May 5, 2021 7:00am - 8:30am MDT
B

9:00am MDT

SOLID, Revisited
Happy 20th Birthday SOLID!

The SOLID principles were introduced in 2000 (and were around individually long before coalescing into the nice acronym). They quickly became tenets of OOP (Object Oriented Programming).

But much has changed in these 20 years, and VOP (Value-Oriented Programming) has been pushed by some as the better way (or at least as another tool in the tool box).
Does SOLID hold up in the VOP world? Does it still apply?

This talk will delve into the original (and sometimes forgotten) motivations and goals behind SOLID. It will (of course) explain what each of the letters of SOLID stand for, and how they apply to OOP (and how they have been distorted in OOP). In particular, we will look at how and whether SOLID applies to Value Oriented Programming - how does SOLID fit into modern C++?

Speakers
avatar for Tony Van Eerd

Tony Van Eerd

Stunt-double for C++ Expert, Christie Digital
Tony has been coding for well over 25 years, and hopefully coding well for most of that. Previously at Inscriber, Adobe, and BlackBerry, he now enables painting with light at Christie Digital. He is on the C++ Committee. He is a Ninja and a Jedi. Follow @tvaneerd


Wednesday May 5, 2021 9:00am - 10:30am MDT
A

11:30am MDT

Semantic Sugar: Tips for Effective Template Library APIs
C++20 concepts give us a brand new way to specify how our generic libraries and algorithms should be used and allow library users to better understand what is expected of them. However, concepts didn't rise from chaos, and before their adoption C++ library authors had other mechanisms to meet that goal.

In this talk I'll briefly discuss concepts, describe a variety of more mature methods for libraries to constrain and tailor their interaction with application code. Mechanisms such as tag-dispatch, specializations and customization points will be compared to concepts and to each other, and usage tips will be presented.

Special attention will be given to the 'semantic' vs. 'syntactic' nature of concepts. I'll show potential pitfalls and 'famous' cases where semantics played a significant role, and present the case for some 'semantic only' concepts, and suggest how they can be used to improve library APIs.

Speakers
avatar for Roi Barkan

Roi Barkan

Professional software developer and architect since 2000, Roi's main focus throughout his career was on high performance and distributed systems, and on implementing complex and innovative algorithms. Roi has been the VP technologies of Istra Research since 2014, where he helps the... Read More →


Wednesday May 5, 2021 11:30am - 1:00pm MDT
C

11:30am MDT

Polymorphism À La Carte
Runtime Polymorphism is accomplished in Object Oriented languages in a variety of ways, each with their own trade-offs, a topic explored by Phil Nash at his CppCon 2020 talk, OO Considered Harmful. Several library authors have implemented runtime polymorphism via Type Erasure and, because Generic Programming is so powerful, these libraries rival the advantages or avoid the problems of the virtual dispatch mechanism intrinsic to the language. The work we present here is the result of having extended one of those frameworks, Zoo, to also support the mechanisms of other languages; despite this support happening in library-level code of an altogether different language, it can be substantially better than the intrinsics.

In particular, we will discuss, with examples, the advantages and disadvantages of these mechanisms:

1. Dynamic dispatch and late binding as in Smalltalk or Objective-C’s message passing
2. Rust Traits
3. Swift Protocols
4. JavaScript’s prototypal inheritance

and how close we have been able to capture their benefits and avoid their problems:

For example, we are able to model Objective-C’s message passing with superior performance to intrinsic v-table based “virtual dispatch”, allowing us to:

1. Achieve Value Semantics as opposed to limiting ourselves to just Reference Semantics.
2. Easily mock implementations to simplify testing using “method swizzling”
3. Very efficiently interop with normal Type-Erased containers that have the same polymorphic interfaces.

This presentation would hopefully help participants to apply the benefits of runtime polymorphism mechanisms from other languages in their C++ code.

Speakers
avatar for Eduardo Madrid

Eduardo Madrid

Tech Lead, Snap, Inc.
Eduardo has been working for many years on financial technologies, automated trading in particular, and other areas where performance challenges can be solved in C++. He contributes to open source projects and teaches advanced courses on Software Engineering with emphasis in Generic... Read More →


Wednesday May 5, 2021 11:30am - 1:00pm MDT
A

11:30am MDT

Writing a C++ 20 Module
This talk will walk through creating a C++ 20 module interface and the implementation of a simple data structure, a functional tree. This will cover how to control export of types and inline code, hiding an implementation, and making sure that necessary un-exported definitions are still reachable.

Speakers
avatar for Steve Downey

Steve Downey

Bloomberg LP


Wednesday May 5, 2021 11:30am - 1:00pm MDT
B

1:30pm MDT

Adventures in SIMD-Thinking
SIMD capabilities are virtually ubiquitous in modern computing hardware, and yet much of that computing capacity often goes unused. This talk will provide a high-level overview of the SSE, AVX, and AVX-512 instruction set architecture provided by Intel microprocessors, and provide some specific examples of real-world problems where additional performance can be gained by thinking "vertically".

We'll begin with a quick, high-level description of the features provided by the SSE, AVX, and AVX-512 instruction sets. We'll then use C++ to compose a simple API employing various compiler intrinsics implementing those instruction sets. At the lowest level, the API will wrap some primitive operations, and then build some very useful basic operations (like multi-register shift) upon those primitives. We'll then build some facilities for comparison and arithmetic, and finally round out the API with functions for load and store. During all of this, we'll use C++ to provide type safety, reduce complexity, and maximize performance.

Next, we'll take a look at how this simple API can be used to improve performance for a handful of interesting problems, like sorting the values stored in a register, creating a very fast 1-D median filter, or high-speed convolution and correlation with kernels that fit within a single register.

Speakers
avatar for Bob Steagall

Bob Steagall

Chief Cook and Bottle Washer, KEWB Computing


Wednesday May 5, 2021 1:30pm - 3:00pm MDT
B
  • Concurrency

1:30pm MDT

Iterators and Ranges: Comparing C++ to D to Rust
The STL introduced an iterator abstraction into C++ that generalized the notion of pointer and allowed for the ability to have arbitrary sequences that could be generically traversed and have algorithms performed on them. But the C++ iterator-pair model isn't the only possible approach to solving this problem. The D Ranges model, while isomorphic to the C++ one, is still quite distinct and has some interesting characteristics. Many languages (including Rust and Python) have an entirely different iteration model from the C++/D one.

Are D Ranges better or worse than C++ Ranges? Is Rust's better than C++'s? Does it depend on what your definition of is is? The goal of this talk is to examine the problem space and find out.

Speakers
avatar for Barry Revzin

Barry Revzin

Jump Trading
Barry is a senior C++ developer at Jump Trading in Chicago, a research and technology driven trading firm. After programming for many years, he got really into the nuances and intricacies of C++ by being unreasonably active on StackOverflow (where is he is the top contributor in C++14... Read More →


Wednesday May 5, 2021 1:30pm - 3:00pm MDT
C

1:30pm MDT

Techniques for Overloading any_invocable
This talk will present techniques for overloading `any_invocable`.

`std::function` is an excellent tool for interface design. It encapsulates almost any object that is invocable the right way. `any_invocable` is an even better tool. It can encapsulate some types that `std::function` can't — the ones that are move-only. It can additionally call qualified overloads of the call operator on the underlying object. Unfortunately, it is still invocable in just one way. You get one list of argument types and that's what you must pass.

Wouldn't it be great if `any_invocable` could have as many overloads of `operator()` as you want? This talk will present techniques for implementing such a class template.

Speakers
avatar for Filipp Gelman

Filipp Gelman

Software Developer, Bloomberg LP
At Bloomberg LP since 2016, Filipp enjoys exploring the obscure, arcane, and esoteric corners of the C++ language. He is known among his coworkers for heavy use of templates, emphasis on compile time computation, and abusing language features for nefarious purposes.


Wednesday May 5, 2021 1:30pm - 3:00pm MDT
A
 
Thursday, May 6
 

5:30am MDT

Lightning Talks
Lightning talks are 5 minute talks on something of interest to C++ programmers. Presentation is open to any C++Now attendee, including Student/Volunteers.

Have a favorite technique or library to share? Employed some C++ feature in a project with amazing/horrible results? Want to start a conversation on Boost 3.0? Submit your proposal for a 5 or 10-minute talk to Michael at lightning@cppnow.org. Be sure to include a title, 3-sentence abstract, and something about yourself.

Come to be amused, enlightened, outraged, or inspired!

Moderators
Thursday May 6, 2021 5:30am - 6:30am MDT
A

7:00am MDT

So You Think You Know How to Work With Concepts?
Concepts may appear easy to use on the surface, but there are a number of traps you can fall into when using them in your generic library. The problems we will be discussing basically boil down to: "I wrote my template library, I tested it on all the types I could think of, but it failed to work with my users' types."

In this session we will see two such traps, and how to remedy them.
1. Using more of types' interface than what the concept declares -- remedied by using concept archetypes.
2. Failure to communicate semantic requirements -- sometimes remedied by emulating semantic constraints with syntactic constraints.

This is a live coding session. It will be assumed that you are already familiar with C++20 concepts. There will be only a super-brief introduction to concepts.

Speakers
avatar for Andrzej Krzemieński

Andrzej Krzemieński

Principal Software Engineering, Sabre Polska
Andrzej is a software developer since 2004. He works mostly with C++ in commercial software, which includes safety-related and high-performance systems. He is a member of the C++ Standards Committee and a Boost developer. He is also a co-organizer of C++ User Group Krakow. Known to... Read More →


Thursday May 6, 2021 7:00am - 8:30am MDT
B

7:00am MDT

CMake + Conan: 3 Years Later
This lecture is a continuation of my C++Now 2018 "Git, CMake, Conan: How to Ship and Reuse our C++ Projects" talk. This time I will share what I've learned and what has changed through the last three years in sharing and reusing C++ projects via CMake and Conan. I will share the updated best practices of packaging C++ projects and the most important highlights of the upcoming Conan 2.0.

If you are interested in package management in large enterprise projects, you probably do not want to miss this talk.

Speakers
avatar for Mateusz Pusz

Mateusz Pusz

Principal Software Engineer | Trainer, EPAM Systems | Train IT
A software architect, principal engineer, and security champion with more than 15 years of experience in designing, writing, and maintaining C++ code for fun and living. A trainer with 10 years of C++ teaching experience, consultant, conference speaker, and evangelist. His main areas... Read More →


Thursday May 6, 2021 7:00am - 8:30am MDT
C

7:00am MDT

Simplest Strong Typing instead of Language Proposal ( P0109 )
Safer and simpler C++ is the goal of many things I am doing. C++ has a rich and strong type system, except for the holes inherited from C. In this talk we will learn how to circumvent those holes and define useful types for stuff where otherwise we would have used plain ints, doubles, or strings. It demonstrates the simplest strong type mechanism of C++ that also works in C, but also a framework that was designed to make it even simpler to define strong types than what was proposed in P0109 as a language extension. We will also look at the perils of using size_t for capacity, indexing and size of containers and how strong types would have prevented some of their constructor usability issues. This leads to the duality of types used for a 1d vector space with a corresponding affine space that might share internal representation but not the corresponding operations, such as representing number of elements versus the distance between elements in an array.

You can take a look at the strong typing framework PSsst here: https://github.com/PeterSommerlad/PSsst and the language proposal at wg21.link/P0109

Speakers
avatar for Peter Sommerlad

Peter Sommerlad

founder, Better Software: Consulting, Training, Reviews
Peter Sommerlad was director of IFS Institute for Software at FHO/HSR Rapperswil, Switzerland. Peter is co-author of the books POSA Vol.1 and Security Patterns and contributed to "97 things every programmer should know". His goal is to make software simpler and safer by Decremental... Read More →


Thursday May 6, 2021 7:00am - 8:30am MDT
A

9:00am MDT

Algorithms from a Compiler Developer's Toolbox
Compiler construction is one of the most researched topics in computer science. As a result, there is a vast library of elegant algorithms that can find optimization opportunities in our programs. While these algorithms have excellent coverage in academic literature and advanced compiler courses, there is little discussion devoted to this topic at industrial conferences.

This session is intended to give a glimpse of the foundations modern optimizing compilers are built on, hopefully helping to develop some intuition about the capabilities of modern compilers. In this talk, I want to present two algorithms that mesmerized me with their unreasonable effectiveness. The first algorithm involves chains of recurrences, which is the theory behind LLVM's scalar evolution analysis. The second is value numbering, which is one of the first optimization passes compiler developers get to implement when they start working on a new compiler.

I will cover the theory and basic math behind these algorithms (high school math knowledge is sufficient), as well as some of the implementations in popular compilers. The talk includes lots of examples and some pointers on how to implement some of these algorithms yourself.

Speakers
avatar for Gábor Horváth

Gábor Horváth

Software Engineer, Microsoft
Gabor started a Ph.D. in 2016. He is a contributor to research projects related to static analysis since 2012. He is a clang contributor, participated in Google Summer of Code twice as a student and many times as a mentor, interned for Apple, Microsoft and Google. He taught C++ and... Read More →


Thursday May 6, 2021 9:00am - 10:30am MDT
A

9:00am MDT

Windows, MacOS and the Web: Lessons from Cross-platform Development at think-cell
When you start porting a large software project -- let's say 700k lines of code that had been running on Windows only for 12 years -- you want to introduce programming interfaces that elegantly hide platform-specific code. Often but now always, the C++ standard gives you such abstractions or you can use cross-platform libraries such as Qt and boost. They are good tools to build on, but there were quite a few cases where none of these were good enough. I will go over some of these cases to discuss the problems we encountered and how we approached them.

Recently, we have started to port some functionality to the web. We wanted to reuse our existing code-base of course, and that meant writing web applications in expressive, type- safe C++ and compiling to WebAssembly. But what do you do when you have to work with legacy JavaScript libraries from C++? I will present our novel tool that can generate type-safe C++ bindings from TypeScript interface definitions to solve that problem. 

Thursday May 6, 2021 9:00am - 10:30am MDT
B

9:00am MDT

Variations on variants
std::variant was added to C++ in 2017 as a type-safe alternative to C's union.
To start us off, I will shortly introduce the rationale of std::variant and the typical ways in which it can be used. I will also try to give insights into the way std::variant is typically implemented, highlighting the memory layout and its run-time performance implications.
The bulk of the talk will then focus on the key differences between std::variant and union, and discuss a common use-case where unions are typically used which std::variant does not support - serialization of streams of a trivially copyable object to files or to network. Then, I'll suggest approaches to tackle this shortcoming: Intrusive-Variant, Variant-of-Base. When presenting and describing the approaches above, I will dive deeper into what the C++ standard says about unions and their pitfalls, and discuss reasoning and issues. Time permitting, I'll finish off with a counterintuitive uses of std::variant - simple and safe mechanism for de-virtualization.
After attending this talk, participants should be better equipped to use this relatively new concept to modernize existing low-level C style code and will have a better understanding of how variants work under the hood.

Speakers
avatar for Roi Barkan

Roi Barkan

Professional software developer and architect since 2000, Roi's main focus throughout his career was on high performance and distributed systems, and on implementing complex and innovative algorithms. Roi has been the VP technologies of Istra Research since 2014, where he helps the... Read More →


Thursday May 6, 2021 9:00am - 10:30am MDT
C

11:30am MDT

Designing Concurrent C++ Applications
We live in a multi-core area, yet our concurrency tools are still primitive. They resemble a lot the goto statement of the era before structured programming become mainstream. How can we improve that?

This session aims at raising the abstraction level from primitive tools like threads and locks to concurrent constructs, that, similar to design patterns, can be combined in various ways for the design of concurrent applications. We want to move the focus from micro-managing thread safety, to building concurrency in the application from design time. This will be done by walking through a series of examples, for each one extracting the concurrency constraints and then designing an appropriate solution. Performance numbers will be provided for all of these.

We will walk through a lot of code examples for building concurrent applications in C++, without using locks. The talk will touch subjects such as: tasks, executors, senders/receivers, and, of course, performance topics.

The overall goal of the talk is to show that concurrency can be approached systematically. The hope is that C++ programmers will abandon threads and synchronization primitives in the favour of high-level concurrency constructs.

Speakers
avatar for Lucian Radu Teodorescu

Lucian Radu Teodorescu

Software Architect, Garmin


Thursday May 6, 2021 11:30am - 1:00pm MDT
B

11:30am MDT

C++ Insights: How Stuff Works, Lambdas and More!
With the help of C++ Insights we'll dive into how things work in C++, through the eyes of the compiler.

We'll look at cases like implicit conversions and in-class initializers. We'll also walk through how the compiler generates lambdas and explore why you might care.

And of course this is C++ so it would be remiss of us not to also take a peek at one of our favourite C++ features: variadic templates!

Welcome to the compiler's world with C++ Insights, and at the very least come away from the talk with a whole new way of looking at the code you write!

Speakers
avatar for Andreas Fertig

Andreas Fertig

Unique Code
Andreas Fertig, CEO of Unique Code GmbH, is an experienced trainer and lecturer for C++ for standards 11 to 20.Andreas is involved in the C++ standardization committee, in which the new standards are developed. At international conferences, he presents how code can be written better... Read More →


Thursday May 6, 2021 11:30am - 1:00pm MDT
A

11:30am MDT

Library Approaches for Strong Type Aliases
It is tempting when writing function and class interfaces to use built-in or library types as function parameters and return values. "I want something to represent a count, I'll use an int", "I want something to represent a name, I'll use a std::string", etc. This works fine up to a point, but allows for confusion: if I pass two ints as the parameters to a std::vector<int> constructor, which is the size and which is the value? Is this float value for "timeout" a value in seconds or milliseconds?

One way to solve this issue is with use-specific classes: std::duration specifies time period with the units encoded, and many SI units libraries abound. However, writing such classes can be tedious and domain specific. To this end, many people advocate the idea of "strong typedefs": the ability to say "this type is like this other type, but is distinct from it", so I can have a "count" type that is essentially an "int", but is distinct from a "timeout_in_seconds" type that is also an int.

I will present the library approach I developed to address this problem, which uses templates to allow you to create specific types for specific purposes, with a set of "properties" that define the interface.

Speakers
avatar for Anthony Williams

Anthony Williams

Just Software Solutions Ltd
Anthony Williams is the author of C++ Concurrency in Action.


Thursday May 6, 2021 11:30am - 1:00pm MDT
C

1:30pm MDT

STL Algorithms as Expressions
This talk started as an effort to implement Computational Geometry algorithms (used in Computer Vision and Graphics) in the Generic Programming style. Because they have many more customization points than STL algorithms, the common approaches used in STL are not sufficient. This led to discoveries that can have surprisingly broad application to STL range algorithms and the way generic code is written. Expression Templates have been used by all of the Linear Algebra libraries for years, but mostly to avoid temporary buffer allocations. However, with a few extensions, they can achieve much more:
* Expressions constructed using the function call syntax provide a natural and expressive way of composition.
* Expression Templates typically support only data types as their template parameters, but allowing function object parameters makes the expression a function object itself. We’ll see how this definition syntax avoids all the boilerplate of function definitions and even lamdba expressions.
* Expressions can be customized using policies, where each policy specifies how it affects certain operations. We’ll discuss the benefits of a customization mechanism that applies given policies to all the operations in the expression.

Speakers
avatar for Oleksandr Bacherikov

Oleksandr Bacherikov

Software Engineer, Snap Inc


Thursday May 6, 2021 1:30pm - 3:00pm MDT
A

1:30pm MDT

UT - C++20 Unit Testing Framework
Testing in C++ is not easy, it often requires a lot of boilerplate code, macro usage and/or understanding of complicated testing frameworks.
But it doesn't have to be like that. C++20 will enable us to reinvent the way we write tests!

In this case study, we will address the difficulty of testing with C++ by implementing a new,
fully functional, macro-free testing framework [1] from scratch with modern C++20 features to make the following snippet compile and run:

01 import ut;
02
03 int main() {
04 "fib"_test = [] { // Running "fib"...
05 fib(7) == 12_i; // fib.cpp:5:FAILED [ 13 == 12 ]
06 }; // tests: 1 | 1 failed
07 } // asserts: 1 | 0 passed | 1 failed

At the end of this session, the audience will have a better understanding of C++20 features such as:

* Modules
* Concepts
* Source Location
* New additions to lambdas
* User-Defined Literals

Additionally, attendees will get familiar with an expressive way of testing with modern C++ based on UT - Unit Testing Framework [2].

Let's get ready to follow the Beyonce rule - 'If you liked it then you "should put a" test on it' and test all the things at C++Now 2021!

[1]: https://godbolt.org/z/a7Mses
[2]: https://github.com/boost-ext/ut

Speakers
avatar for Kris Jusiak

Kris Jusiak

Software Architect, Quantlab Financial
Kris is a Software Architect passionate about programming and who has worked in different industries over the years including telecommunications, games and most recently finance for Quantlab Financial, LLC. He has an interest in modern C++ development with a focus on performance and... Read More →


Thursday May 6, 2021 1:30pm - 3:00pm MDT
C

1:30pm MDT

Frictionless Allocators
The benefits of users taking control over their own memory allocation strategy have been demonstrated many times at previous ACCU conferences. However, despite these benefits and ongoing support in the C++ Standard, allocator aware software has not yet become widespread throughout the C++ community. One of the main sources of resistance is perceived complexity when providing allocator support in our libraries, which is the prerequisite for empowering users to make choices optimal to their circumstances. This talk will tackle that complexity head-on, seeking to remove the friction between library support and user. First, we will examine the sources of friction when writing allocator awre code in C++ today. Then, we will then suggest a small selection of potential language extensions that would permit much cleaner expression of the same designs deployed today. We aim to take the friction out of the system! This talk provides an early preview of several language proposals we hope to send to the ISO C++ committee for C++23 and beyond; it will touch on lessons learned from an early prototype implementation; and we will discuss how to judge when the proposal and experience with it are mature enough to take up valuable committee time to move forward!

Speakers
avatar for Alisdair Meredith

Alisdair Meredith

Senior Developer, BloombergLP
Alisdair Meredith is a software developer at BloombergLP in New York, and the C++ Standard Committee Library Working Group chair.He has been an active member of the C++ committee for just over a decade, and by a lucky co-incidence his first meeting was the kick-off meeting for the... Read More →


Thursday May 6, 2021 1:30pm - 3:00pm MDT
B
  • Type Design

3:30pm MDT

Lightning Talks (TBC)
Lightning talks are 5 minute talks on something of interest to C++ programmers. Presentation is open to any C++Now attendee, including Student/Volunteers.

Have a favorite technique or library to share? Employed some C++ feature in a project with amazing/horrible results? Want to start a conversation on Boost 3.0? Submit your proposal for a 5 or 10-minute talk to Michael at lightning@cppnow.org. Be sure to include a title, 3-sentence abstract, and something about yourself.

Come to be amused, enlightened, outraged, or inspired!

Moderators
avatar for Michael Caisse

Michael Caisse

Ciere, Inc.
Michael Caisse started using C++ with embedded systems over 30 years ago. He continues to be passionate about combining his degree in Electrical Engineering with elegant software solutions and is always excited to share his discoveries with others.Michael works for Ciere Consulting... Read More →

Thursday May 6, 2021 3:30pm - 4:30pm MDT
A
 
Friday, May 7
 

7:00am MDT

What Neighborhoods Owe to Each Other: Rights, Duties, Immunities and Disabilities of Functions and Objects
Our understanding of a program is formed locally: we design or examine a single neighborhood of a program at a time. The neighborhoods we consider most often are those of functions and objects, in the context of the interfaces that surround them, but independently of the implementations beyond those interfaces.

But these neighborhoods are not fully independent. Objects and functions form ongoing relationships with each other, each fulfilling their own obligations by relying on the obligations of others.

The field of jurisprudence provides us with terms for these relationships: right and duty; immunity and disability. Casting these inter-neighborhood relationships in these terms provides insight into the fundamentals of programming and can help us avoid problems involving as resource lifetime, aliasing, and race conditions.

While this presentation is intended to stand on its own, it continues the examination of procedural logic in my earlier talks, such as “The Truth of a Procedure” and “Neighborhoods Banding Together.” It improves upon the material in my 2017 talk, “Locally Atomic Capabilities and How to Count Them.”

Speakers
avatar for Lisa Lippincott

Lisa Lippincott

Software Architect, Tanium
Lisa Lippincott designed the software architectures of Tanium and BigFix, two systems for managing large fleets of computers. She's also a language nerd, and has contributed to arcane parts of the C++ standard. In her spare time, she studies mathematical logic, and wants to make computer-checked... Read More →


Friday May 7, 2021 7:00am - 8:30am MDT
B
  • Interfaces

7:00am MDT

Don't constexpr All the Things
The constexpr metaprogramming model, which involves annotating code with indicators of compile-time or run-time suitability, has been steadily increasing in capabilities since its debut in C++11. These efforts have been in support of the stated goal of making metaprogramming accessible to even novice developers. Unfortunately, the result is a complicated and unintuitive programming model. Elsewhere, an extremely compelling alternative that is intuitive and more powerful has been implemented in Sean Baxter's circle compiler. This talk describes the limitations of the constexpr metaprogramming model and introduces its persuasive alternative, circle metaprogramming.

Speakers
avatar for David Sankel

David Sankel

Software Engineering TL, Bloomberg
David Sankel is a Software Engineering Manager/TL at Bloomberg and an active member of the C++ Standardization Committee. His experience spans microservice architectures, CAD/CAM, computer graphics, visual programming languages, web applications, computer vision, and cryptography... Read More →


Friday May 7, 2021 7:00am - 8:30am MDT
C
  • Language

7:00am MDT

Simplest Safe Integers
This talk will show some of the pitfalls and undefined behavior of C++'s C heritage with respect to built-in types and available operations. It will use the upcoming MISRA-C++ guidelines on that area to motivate and guide a simple integer library that allows easy conformance to what MISRA-C calls "essential type model" and that will be similarly represented in C++. Using that library of "integer" types, you will be able to write code that if it would be using regular integer types would be conforming with MISRA guidelines covering that area. While not "perfect" in the sense of safety it will provide types that do not promote, stick to their signedness and number of bits, wand wrap around. For example, adding an 200_ui8 + 56_ui8 will result in 1_ui8. The implementation will demonstrate the use of enum class types, operator overloading, user-defined literals.

Code is available at github.com/PeterSommerlad/PSsimplesafeint

Speakers
avatar for Peter Sommerlad

Peter Sommerlad

founder, Better Software: Consulting, Training, Reviews
Peter Sommerlad was director of IFS Institute for Software at FHO/HSR Rapperswil, Switzerland. Peter is co-author of the books POSA Vol.1 and Security Patterns and contributed to "97 things every programmer should know". His goal is to make software simpler and safer by Decremental... Read More →


Friday May 7, 2021 7:00am - 8:30am MDT
A

9:00am MDT

Taskflow: A Lightweight Heterogeneous Task Graph Programming System with Control Flow
Modern computing applications rely on a heterogeneous mix of CPUs and GPUs to achieve key performance milestones that go beyond traditional capabilities. However, programming these applications often requires complex expert-level tools and a deep understanding of software methodologies. Decades of research in high productivity computing has yielded methods and languages that offer either programmer productivity or performance scalability, but rarely both simultaneously. Very few systems allow developers to efficiently express
CPU-GPU dependent tasks that integrate control flow in a general-purpose setting.

In this talk, we are going to address a long-standing question: "How can we make it easier for C++ developers to write parallel and heterogeneous programs with high performance and simultaneous high productivity?" We will introduce Taskflow, A Lightweight Heterogeneous Task Graph Computing System with Control Flow. We will present an expressive CPU-GPU task graph programming model by leveraging modern C++ closure. Our model enables efficient implementations of parallel and heterogeneous decomposition strategies. The expressiveness of our model lets developers perform rather a lot of work with relative ease of programming. More importantly, we will discuss a new conditional tasking interface to support general control flow beyond the capability of the directed acyclic graph (DAG) model that prevails in existing systems. To support our programming model with high performance, we will present an efficient work-stealing algorithm that dynamically balances the thread resources with task parallelism. Finally, we will discuss successful use cases and applications to which Taskflow has been applied, and draw the conclusion for C++ in face of future heterogeneity.

The Taskflow project is available at https://taskflow.github.io/

Speakers
avatar for Tsung-Wei Huang

Tsung-Wei Huang

Assistant Professor, University of Utah
As a university faculty member, a central theme of my research is to make parallel computing easier to handle. I am passionate about using modern C++ technology to solve parallel and heterogeneous computing problems. One such effort is my Taskflow project (https://taskflow.github.io... Read More →


Friday May 7, 2021 9:00am - 10:30am MDT
A

9:00am MDT

The Quest For A Better Crash
Crashed ! Now What ? “It works on my machine” :) Those little words that make the heart of QAs and clients skip a beat. Sometimes reproducing a crash on a developer's machine is next to impossible. Most of the time remote debugging is out of the question and all you’re left with are some scant log files and maybe a memory dump file, if you’re lucky. Wouldn’t you like to know the exact point of failure in the program and how it got there, on the client’s PC ?
How can you get your hands on a StackTrace of that crash on the client’s machine ? And how can you make any sense of it without symbols (client deployed Release build) ?
In this session, I’ll present a Windows specific technique we developed, that my team uses regularly to debug such scenarios in production. We leverage OS APIs like the Image Help Library (ImageHlp.dll), the Debug Help Library (DbgHelp.dll) to work with PE/COFF images and PDBs and reconstruct symbolicated StackTraces for Release crashes in production. The technique and APIs work all the way from Windows XP up to Windows 10, both for x86 and x64 executables.
We’ll see how symbols are loaded and how PDBs work, we’ll discuss partial/incremental PDBs and we’ll have to get comfortable with Structured Exception Handling (SEH). Did I mention Address Space Layout Randomization (ASLR) ? This is going to be fun :)
Come with me on this journey and we’ll walk the stack together, to reconstruct each frame, from a few pointers and some symbols.
From highly efficient platform-specific implementations, to boost::Stacktrace, to P0881, to C++23... we’ll analyze together the requirements, constraints and advantages of each design decision.

Speakers
avatar for Victor Ciura

Victor Ciura

Principal Engineer, CAPHYON
Victor Ciura is a Principal Engineer at CAPHYON, Technical Lead on the Advanced Installer team and a Microsoft MVP (Developer Technologies).He’s a regular guest at Computer Science Department of his Alma Mater, University of Craiova, where he gives student lectures & workshops on... Read More →


Friday May 7, 2021 9:00am - 10:30am MDT
C

9:00am MDT

Taking Template Classes One Step Further with Opaques Types and Generic NTTPs
With the new features brought by C++20 has come a time to revise the way interfaces are designed, starting with the needs of users. In this talk, we explore how opaque types and C++20's generic NTTPs can be leveraged to maximize the expressivity of template classes.

In the first part, we will discuss how opaque types and type erasure can help reduce template parameters bloat when no compile-time programming technique can help improve performance.

In the second part, we will see how C++20's template contexts can act as Embedded Domain Programming Languages (EDSLs) mini-compilers thanks to generic NTTP's and how Expression Template (ET) can be taken one step further when injected as template parameters.

We will demonstrate that generic NTTP can be leveraged to produce at the same time terser interfaces and more generic customization points. We will illustrate these approaches on the canonical problem of generic multidimensional arrays that have withstood standardization for decades and which is finally about to surrender. We will show in particular how the new metaprogramming techniques allowed by C++20 can be used to go further on the path opened by mdspan.

Finally, we will discuss how making C++ kind-generic would constitute the next big step for the core language regarding this topic, and how it could unleash the craziest ideas in terms of generative programming.

Speakers
avatar for Joel Falcou

Joel Falcou

assistant professor, LRI - Université paris 11
Joel Falcou is an assistant professor at the University Paris-Sud andresearcher at the Laboratoire de Recherche d'Informatique in Orsay, France. His researches focus on studying generative programming idioms and techniques to design tools for parallel software development. The two... Read More →
avatar for Vincent Reverdy

Vincent Reverdy

Researcher in Astrophysics and Mathematics, Ecole Normale Supérieure
Vincent has been working as a post-doctoral researcher at the University of Illinois at Urbana-Champaign (USA) since he obtained his PhD at the Paris observatory (France) in november 2014. His main scientific interests are related to cosmology and general relativity. He his particularly... Read More →


Friday May 7, 2021 9:00am - 10:30am MDT
B

11:30am MDT

What Belongs In The C++ Standard Library?
What belongs in the C++ Standard Library? Should it be large and all encompassing? Or should it be small and focused? For decades, the C++ community and committee has struggled with this question.

In this talk, Bryce Adelstein Lelbach, the chair of C++'s Library Evolution group will present the history of the Standard Library's scope, from the days before the first C++ Standard, to Stepanov's STL, to Boost, the long C++0x era, the last decade of regular C++ Standard releases. He'll also present his answer to the question and the principles that he believes should guide stewardship of the C++ Standard Library.

Speakers
avatar for Bryce Adelstein Lelbach

Bryce Adelstein Lelbach

HPC Programming Models Architect, Principal Architect at NVIDIA, Standard C++ Library Evolution Chair
Bryce Adelstein Lelbach has spent over a decade developing programming languages and software libraries. He is a Principal Architect at NVIDIA, where he leads programming language standardization efforts and drives the technical roadmap for NVIDIA's HPC and Quantum compilers and libraries... Read More →


Friday May 7, 2021 11:30am - 1:00pm MDT
A

1:30pm MDT

Future of Boost
The people who bring you Boost and C++ Now! talk and answer questions about what they see coming.

Friday May 7, 2021 1:30pm - 3:00pm MDT
A
 
  • Timezone
  • Filter By Date C++Now 2021 May 2 - 7, 2021
  • Filter By Venue Online
  • Filter By Type
  • • Algorithms & Concepts
  • • Concurrency
  • • Interfaces
  • • Language
  • • OOP
  • • Text
  • • Tools
  • • Type Design
  • lightning talks
  • social
  • workshop


Filter sessions
Apply filters to sessions.