CppCon 2024 Embracing an Adversarial Mindset for C++ Security -- Amanda Rousseau

Registration is now open for CppCon 2024! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2024!

Embracing an Adversarial Mindset for C++ Security

Wednesday, September 18 10:30 - 12:00 MDT

by Amanda Rousseau

Summary of the talk:

In an era where cybersecurity threats are ever-evolving, securing C++ applications has never been more critical. This keynote will explore how adopting an adversarial mindset can empower developers to proactively identify and mitigate vulnerabilities. We will delve into common C++ vulnerabilities, the “Rule of Two” security guidelines, and practical strategies for reducing attack surfaces and defending against attack vectors. Additionally, we will discuss recent trends in vulnerabilities, highlight bug bounty costs, and examine real-world examples of vulnerabilities exploited by threat actors. This talk will provide valuable insights into adopting an adversarial mindset and implementing robust security practices in your C++ projects.


Amanda is an industry expert on malware and understanding ways to be robust against attacks.

Opaque Pointer Pattern in C++ -- Daniel Sieger

sieger-opaquepattern.pngAfter reading this article, you should understand the basics of the opaque pointer pattern and how you can implement it using std::unique_ptr. I also gave some hints on when it is appropriate to use it and when maybe not.

Opaque Pointer Pattern in C++

by Daniel Sieger

From the article:

The basic problem is that C++ class declarations expose private details of the class. Private member functions and data members need to be declared in the header. Here’s an example for illustration:

// Point.h


class Point
{
public:
  Point(float x, float y);
  float x();
  float y();

private:
  float x_;
  float y_;
};

While users of this class don’t have direct access to the private data members x_ and y_, there is still a dependency: If you change the private implementation details of Point, all other compilation units that include Point.h know about the change and need to be re-compiled.

This only gets worse for more complex dependency chains, e.g., when there are dependencies to other classes internal to the module that need to be included. To a certain degree, this can be dealt with by using forward declarations. However, at the end of the day there is an information leak: Private implementation details are leaking to clients. This goes directly against the idea of information hiding.

The opaque pointer pattern helps to deal with this problem.

CppCon 2024 Reflection Is Not Contemplation -- Andrei Alexandrescu

Registration is now open for CppCon 2024! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2024!

Reflection Is Not Contemplation

Friday, September 20 14:45 - 15:45 MDT

by Andrei Alexandrescu

Summary of the talk:

The C++ community has long been interested in reflection, and we have made significant progress in adding core reflection capabilities to the language. While there is emerging clarity on the querying side of reflection—inspecting existing code artifacts programmatically—there is considerably less consensus on the generative aspect: using reflection insights to emit new code. As a result, current proposals showcase a stark contrast between well-polished reflection query capabilities and limited code generation capabilities.

Reifying only the reflection of preexisting code in an Ouroboros manner leads to a curious circularity that hinders the synthesis of new artifacts. This talk provides examples that demonstrate the necessity of generative capabilities in reflection and discusses current and upcoming proposals for generative extensions in C++ reflection.


Andrei Alexandrescu is a Principal Research Scientist at NVIDIA. He wrote three best-selling books on programming (Modern C++ Design, C++ Coding Standards, and The D Programming Language) and numerous articles and papers on wide-ranging topics from programming to language design to Machine Learning to Natural Language Processing to fundamental algorithms. Andrei holds a PhD in Computer Science from the University of Washington and a BSc in Electrical Engineering from University "Politehnica" Bucharest. He is the Vice President of the D Language Foundation.

Enum Class Improvements for C++17, C++20 and C++23 -- Bartlomiej Filipek

Filipek-enumclass.pngThe evolution of the C++ language continues to bring powerful features that enhance code safety, readability, and maintainability. Among these improvements, we got changes and additions to enum class functionalities across C++17, C++20, and C++23. In this blog post, we’ll explore these advancements, focusing on initialization improvements in C++17, the introduction of the using enum keyword in C++20, and the std::to_underlying utility in C++23.

Enum Class Improvements for C++17, C++20 and C++23

by Bartlomiej Filipek

From the article:

Before diving into the enhancements, let’s briefly recap what enum class is. An enum class (scoped enumeration) provides a type-safe way of defining a set of named constants. Unlike traditional (unscoped) enums, enum class does not implicitly convert to integers or other types, preventing accidental misuse. Here’s a basic example:

#include <iostream>

enum class Color {
    Red,
    Green,
    Blue
};

int main() {   
    Color color = Color::Red;

    if (color == Color::Red)
        std::cout << "The color is red.\n";

    color = Color::Blue;

    if (color == Color::Blue)
        std::cout << "The color is blue.\n";

    // std::cout << color; // error, no matching << operator
    // int i = color;      // error: cannot convert
}

CppCon 2024 Gazing Beyond Reflection for C++26 -- Daveed Vandevoorde

Registration is now open for CppCon 2024! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2024!

Gazing Beyond Reflection for C++26

Friday, September 20 16:15 - 18:00 MDT

by Daveed Vandevoorde

Summary of the talk:

In less than a year since its original publication, the WG21 proposal “Reflection for C++26” (P2996) has made good progress towards its titular goal.  From its inception, we intended that design to offer a modest-but-useful set of features with a solid foundation on top of which we will be able to incrementally grow an easy-to-use, rich, and extensible C++ meta-programming framework.  This keynote will review some of the fundamental tools proposed in P2996 and follow up with a vision for some additional capabilities that we’re working on.


David ("Daveed") Vandevoorde is a Belgian computer scientist who lives near Princeton, NJ, USA. He is vice-president of engineering at the Edison Design Group (EDG), where he contributes primarily to the implementation of their C++ compiler front end. He is an active member of the C++ standardization committee where he is primarily active in the core language evolution work. His recent work in that context has primarily been about extending the capabilities of “constexpr evaluation”. Daveed is also one of the five members of the committee’s “direction group”. He is the primary author of the well-regarded “C++ Templates: A Complete Guide” (now available in its second edition).

CppCon 2024 When Nanoseconds Matter: Ultrafast Trading Systems in C++ -- David Gross

Registration is now open for CppCon 2024! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2024!

When Nanoseconds Matter: Ultrafast Trading Systems in C++

Thursday, September 19 10:30 - 12:00 MDT

by David Gross

Summary of the talk:

Achieving low latency in a trading system cannot be an afterthought; it must be an integral part of the design from the very beginning. While low latency programming is sometimes seen under the umbrella of "code optimization", the truth is that most of the work needed to achieve such latency is done upfront, at the design phase. How to translate our knowledge about the CPU and hardware into C++? How to use multiple CPU cores, handle concurrency issues and cost, and stay fast?

In this talk, I will be sharing with you some industry insights on how to design from scratch a low latency trading system. I will be presenting building blocks that application developers can directly re-use when in their trading systems (or some other high performance, highly concurrent applications).

Additionally, we will delve into several algorithms and data structures commonly used in trading systems, and discuss how to optimize them using the latest features available in C++. This session aims to equip you with practical knowledge and techniques to enhance the performance of your systems and make informed decisions about the tools and technologies you choose to employ.


 

CppCon 2024 To Int or to Uint, This is the Question -- Alex Dathskosky

Registration is now open for CppCon 2024! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2024!

To Int or to Uint, This is the Question

Thursday, September 19 15:15 - 16:15 MDT

by Walter E. Brown

Summary of the talk:

In our daily work, we often use integral data types to perform arithmetic calculations, but we may not always consider how the selection of the data type can affect performance and compiler optimizations. This talk will delve into the importance of choosing the correct data type for the job and how it impacts compiler optimizations. We will also examine the overall performance implications for the application. We will explore specific algorithms where using unsigned data types is more beneficial and other situations where signed data types are the best choice. Furthermore this talk will dive into the differences between signed and unsigned integers, how the processor handles certain operations and explain many of the surprising pitfalls of using integral types.
Attendees will come away with a deeper understanding of how data type selection can impact their code and how to make better choices for optimal performance.

This session will follow the guidelines from my short article on LinkedIn but it will go into higher details and contain more examples and explanations.


Alex has over 17 years of software development experience, working on systems, low-level generic tools and high-level applications. Alex has worked as an integration/software developer at Elbit, senior software developer at Rafael, technical leader at Axxana, Software manager at Abbott Israel and now a group manager a technical manager at Speedata.io an Exciting startup the will change Big Data and analytics as we know it .On His current Job Alex is developing a new CPU/APU system working with C++20, Massive metaprogramming and development of LLVM to create the next Big thing for Big Data. _x000D_
_x000D_
Alex is a C++ expert with a strong experience in template meta-programming. Alex also teaches a course about the new features of modern C++, trying to motivate companies to move to the latest standards.

The Difference Between Undefined Behavior and Ill-formed C++ Programs -- Raymond Chen

RaymondChen_5in-150x150.jpgThe C++ language has two large categories of “don’t do that” known as undefined behavior and ill-formed program. What’s the difference?

The Difference Between Undefined Behavior and Ill-formed C++ Programs

by Raymond Chen

From the article:

The C++ language has two large categories of “don’t do that” known as undefined behavior and ill-formed program. What’s the difference?

Undefined behavior (commonly abbreviated UB) is a runtime concept. If a program does something which the language specified as “a program isn’t allowed to do that”, then the behavior at runtime is undefined: The program is permitted by the standard to do anything it wants. Furthermore, the effect of undefined behavior can go backward in time and invalidate operations that occurred prior to the undefined behavior. It can do things like execute dead code. However, if your program avoids the code paths which trigger undefined behavior, then you are safe.

CppCon 2024 C++ Exceptions for Smaller Firmware -- Khalil Estell

Registration is now open for CppCon 2024! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2024!

C++ Exceptions for Smaller Firmware

Tuesday, September 17 10:30 - 12:00 MDT

by Khalil Estell

Summary of the talk:

For years, developers have overlooked a powerful tool for reducing binary size: C++ exceptions. Join me on a deep dive into the world of exceptions and discover how they can be harnessed to create more space efficient firmware. We’ll explore the requirements and best practices of embedded development, and show what is required to use exceptions in that environment. By the end of this talk, you’ll have a thorough understanding of how exceptions are handled, what their space costs are, and how exceptions compare to functional errors as values.


Khalil is a ISO C++ Committee Member and has extensive experience writing production firmware.

CppCon 2024 An Ode to Concepts -- Nina Ranns

Registration is now open for CppCon 2024! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2024!

An Ode to Concepts

Friday, September 20 09:00 - 10:00 MDT

by Nina Ranns

Summary of the talk:

Concepts are a long awaited C++ feature. They allow constraining a template in a much more elegant way than various enable_if tricks. In this lecture we cover the basics of concepts syntax, how to write a concept and how to apply a concept in your code. Then we look at one woman's experience of implementing a heavily constrained type before and after introduction of concepts.


Nina Ranns has been a member of the C++ standard committee since 2013, focusing mostly on the core part of the language, and committee secretary since 2018. Throughout her career she has worked for Siemens, Motorola, Datasift, and Symantec on everything from parts of the UMTS network to cloud based antivirus products. Currently an independent consultant with contracts for EDG, QT, and most recently Bloomberg, where she is eagerly extending her library knowledge and helping create new polymorphic-allocator friendly library types.