Loading…
CppCon 2021 has ended
• const/Units/Time [clear filter]
Tuesday, October 26
 

10:30am MDT

Back to Basics: const and constexpr
It is a virtue to program as const as possible in modern C++. Your program is by design way more type safe, has fewer concurrency issues, and runs with high probability faster.
Const has many flavors in modern C++. Thanks to const, you can protect a value against mutation. With constexpr, you can initialize and compute values at compile time. Thanks to conteval, a computation can only run at compile time. In the end, constinit empowers you to initialize a modifiable value at compile time.

Let me show you in my lecture how you can initialize a value with constexpr and constinit in a thread-safe way. Let me show you how const and constexpr help you protect values from mutation and, therefore, make them immune to data races. Finally, let me show you how constexpr and consteval empowers you to improve the performance of your program and get functions that are by design easy to test, easy to maintain, and implicitly thread-safe.

ALL TALK SESSIONS CAN BE ACCESSED FROM THE MAIN LOBBY: https://cppcon.digital-medium.co.uk/

Speakers
avatar for Rainer Grimm

Rainer Grimm

C++ trainer, Modernes C++
I've worked as a software architect, team lead, and instructor since 1999. In 2002, I created company-intern meetings for further education. I have given training courses since 2002. My first tutorials were about proprietary management software, but I began teaching Python and C... Read More →


Tuesday October 26, 2021 10:30am - 11:30am MDT

12:30pm MDT

Implementing static_vector: How Hard Could it Be?
Delayed broadcast

static_vector is a std::vector that allocates things on the stack instead of the heap. We have std::vector, so it should be easy to write a non-allocating version, right?

Sadly, it's not quite that simple. There are many aspects of the vector interface that make sense based on a container that can reallocate, but do not make sense for a container that cannot. This leads to some API differences. static_vector also faces certain challenges around constexpr that makes it both more and less constexpr than std::vector.

We will go into detail on how std::vector and how static_vector work, how they are similar, and how they differ. This presentation will be focusing on lower-level details and interactions with specific language features in C++20 and (hopefully) C++23. There will be lots of code examples, and we'll step through how they work and where they fall short, trying to build up to a working, production-ready solution.

ALL TALK SESSIONS CAN BE ACCESSED FROM THE MAIN LOBBY: https://cppcon.digital-medium.co.uk/

Speakers
avatar for David Stone

David Stone

Software Engineer, Quantlab
David Stone has worked on autonomous vehicles, large-scale distributed systems, and now works developing software for high-frequency trading. He is a member of the C++ Standardization Committee, where he chairs the Modules Study Group (SG2) and is the vice chair of the Evolution Working... Read More →


Tuesday October 26, 2021 12:30pm - 1:30pm MDT
Online D
  • const/Units/Time, Online
 
Wednesday, October 27
 

9:35am MDT

A Crash Course in Calendars, Dates, Time, and Time Zones
Before C++11, the C++ Standard Library did not have much support for working with time. C++11 changed all that and introduced the chrono library as part of the Standard Library. With its introduction, C++ gained a standard way to work with durations, clocks, and time points. It allows you to perform arithmetic operations with durations and time points, to convert between different units of time, and more. The library also comes with a number of clocks, including a high-resolution clock which makes it easy to quickly time how long a piece of code executes, e.g. for benchmarking, all without needing any additional libraries.
C++20 has extended the chrono library and added support for calendars, dates, and time zones. It allows you to represent specific days of a year, even something like the 3rd Monday of July or the last day of February, and to perform arithmetic operations with dates. Time can now be expressed in specific time zones, and, of course, converting time between different time zones is supported as well.

ALL TALK SESSIONS CAN BE ACCESSED FROM THE MAIN LOBBY: https://cppcon.digital-medium.co.uk/

Speakers
avatar for Marc Gregoire

Marc Gregoire

Software Architect, Nikon Metrology
MARC GREGOIRE is a software project manager and software architect from Belgium. He graduated from the University of Leuven, Belgium, with a degree in "Burgerlijk ingenieur in de computer wetenschappen" (equivalent to a master of science in engineering in computer science). The... Read More →


Wednesday October 27, 2021 9:35am - 10:05am MDT
 
Thursday, October 28
 

10:30am MDT

C++20’s <chrono> Calendars and Time Zones in MSVC
The <chrono> header has existed since C++11, but C++20 dramatically increased its capabilities. MSVC has completed this C++20 feature and this session will focus on the development of our implementation and Windows-specific considerations that we encountered. For instance, how do we know if a given point in time is during a leap second insertion? Where do we get the data for time zones? If you are excited by these new chrono features and want to support a Windows platform, come and learn about its developments and caveats for a Windows implementation!

We will also touch on how STL maintainers and our valued external contributors developed the new features collaboratively. If you’re interested in participating in our open-source repo by reporting issues, contributing to discussions, or submitting pull requests, we hope that hearing about an example of collaboration will encourage you to visit our repo in the future.

ALL TALK SESSIONS CAN BE ACCESSED FROM THE MAIN LOBBY: https://cppcon.digital-medium.co.uk/

Speakers
avatar for Miya Natsuhara

Miya Natsuhara

Software Engineer, Microsoft


Thursday October 28, 2021 10:30am - 11:30am MDT
 
  • Timezone
  • Filter By Date CppCon 2021 Oct 24 -29, 2021
  • Filter By Venue online
  • Filter By Type
  • • Algorithms/Functional
  • • Async/Concurrency/Parallelism
  • • C++20/Future of C++
  • • Code Design
  • • const/Units/Time
  • • Education/Coaching
  • • Embedded
  • • GPU/Graphics
  • • Modules/Libraries
  • • Real-time/Data Science
  • • Software Design
  • • Templates/Concepts
  • • Testing/Error Handling
  • • Tooling/Debugging
  • • Type Design
  • Business
  • Social
  • Access


Filter sessions
Apply filters to sessions.