Die im Konferenzprogramm der OOP 2022 Digital angegebenen Uhrzeiten entsprechen der Central European Time (CET).
Unser Programm gibt es auch als praktische PDF-Datei >>Zum Download
This tutorial will demystify some of C++ complexities by showing clear guidelines to simpler use of specific language features for designing functions and types of your system. From the experience in specifying new MISRA C++ guidelines the author will show how to write safer C++ for embedded and other systems.
Learning goals consist of
Target Audience: Developers
Prerequisites: Practical knowledge of C++
Level: Advanced
Extended Abstract
This tutorial is trying to simplify your use of C++. We have many great rule sets to chose from, some partially outdated, like Scott Meyers 3rd edition, some futuristic, like the C++ core guidelines. While working on the AUTOSAR C++ and new MISRA C++ guidelines I found that many of the guidelines forbid things without giving actual guideline on how to do things and when to deviate.
Also many talks (mine included) on C++ explain the modern features and show how they work, but only few put things into context and show what to give up and how things combine sanely.
This full day tutorial is the result of thinking about that. It won’t show C++20 feature by feature, but gives a coherent set of practices to improve your design and code using existing standard C++ features where they give you benefits.
We will cover the following topics:
If you are brave enough, bring your own examples that we can look at and discuss where they are perfect and where they could be improved.
C++20 is now a year old. Time to take a closer look at the benefits you get when using C++ for standards 11 to 20. You learn about Coroutines by building a coroutine-based parser. The new ranges and the spaceship operator help you write less code. You will learn how Concepts help you to express constraints better and improve error messages. Doing things at compile-time saves run-time. Let‘s see how C++20 improves your code with the new features consteval and constinit. After this talk, you learned some C++20 features and saw the improvements to C++17 code.
Target Audience: Developers
Prerequisites: Knowledge about at least C++11
Level: Advanced
Extended Abstract
C++20 is now a year old. The major compilers already provide a solid support for the new standard. It is time to take a closer look and figure out the benefits you get when using C++20. Because there are so many improvements in C++20, we will focus on: Concepts, Coroutines, ranges, the spaceship operator, and compile-time evaluation.
Coroutines are the feature that likely will have a strong impact on future finite state machine code. In a brief tour, we will see what we need to do for building a coroutine-based byte-stream parser and how this code is so much more beautiful than without Coroutines.
Less code is always a good thing. The new ranges part of the STL helps us achieve this goal. We will take a brief look at how ranges simplify our code.
Speaking about less code, how about writing a class with all comparison operations without having to write an awful amount of boilerplate code? Sounds good? Then let's see how C++20 helps us there with the spaceship operator.
And while we are speaking about less code, generic programming comes to mind. Concepts give us a whole new way to express constraints and requirements in generic code. Concepts make our code better readable while, at the same time, give us way better error messages.
We don't stop there. Together we will look at the updates to the compile-time world. With consteval and constinit we have two new keywords allowing us new things to do. A lot of former restrictions of constexpr functions were dropped as well. The most popular is probably the ability to dynamically allocate memory at compile-time. We will explore these features using some practical examples.
After this talk, you will have seen the probably most impactful features of C++20. You learned by examples how to use them. The comparisons to pre-C++20 code give you a good understanding of what your benefits are by using C++20.
Andreas Fertig, CEO of Unique Code GmbH, is an experienced trainer and consultant 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. He publishes specialist articles, e.g., for iX magazine, and has published several textbooks on C++.
With C++ Insights (https://cppinsights.io), Andreas has created an internationally recognized tool that enables users to look behind the scenes of C++ and thus understand constructs even better.
Before working as a trainer and consultant, he worked for Philips Medizin Systeme GmbH for ten years as a C++ software developer and architect focusing on embedded systems.
Vortrag Teilen
C++ class design has been error prone since the beginning, until Scott Meyers told us about the Rule-of-Three. But even that is not enforced by the language. In addition, C++11 changed the set of compiler-provided special member functions and the intrinsic rules have become more complicated. However, instead of starting from the rules for special member functions, we will look at what role a class type plays and how that maps on what special member functions to define and how, if any. Examples for class roles are Value, Relationship, Manager (scoped, unique, general), Mix-in.
We will also look at the roles of member variable types that influence or imply the role of the class type. The role of a class will also take out many mysteries of move operations and will lead to clear guidance when and how to provide move operations: for suppressing copying, for managing unique ownership (Unique Manager) or for optimizing object copies (General Manager). We will rehearse the Rule of Zero and learn more about the Rule of Five/Six, the Rule of DesDeMovA, and the Rule of Unique Three. This all will enable you to much more consciously and safely design your class types and combine types of member variables. You will have then the ability to select from a few reasonable combinations from the plethora of possibilities of special member function combinations: {public:,protected:,private:} x {destructor, default constructor, copy constructor, copy assignment, move constructor, assignment} x {noexcept(true),noexcept(false)} x { =default, =delete, {/body/}, not declared } (math as homework)
Target Audience: Developers
Prerequisites: C++ class design
Level: Expert
Vortrag Teilen
For many embedded C++ applications, compliance with the AUTOSAR or Misra rules is required. Among them is AUTOSAR Rule A18-5-5 which does not allow memory allocations with new. Since new and delete violate A18-5-5, the default STL containers must not be used in applications requiring AUTOSAR compliance. This holds for many embedded applications. With the allocators available since C++17 in the namespace std::pmr (polymorphic memory resources) these requirements can often be satisfied.
Target Audience: Architects, Developers, Project Leader
Prerequisites: Good C++ knowledge
Level: Advanced
Extended Abstract
For many embedded C++ applications, compliance with the AUTOSAR or Misra rules is required. Among them is AUTOSAR Rule A18-5-5.
Memory management functions shall ensure the following:
(a) deterministic behavior resulting with the existence of worst-case execution time,
(b) avoiding memory fragmentation,
(c) avoid running out of memory,
(d) avoiding mismatched allocations or deallocations,
(e) no dependence on non-deterministic calls to kernel.
This rule has far-reaching consequences, because per default the C++ standard library containers allocate their memory with new and free it with delete. These calls
• do not have deterministic execution times.
• can cause memory fragmentation.
Since new and delete violate A18-5-5, the default STL containers must not be used in applications requiring AUTOSAR compliance. This holds for many embedded applications.
With the allocators available since C++17 in the namespace std::pmr (polymorphic memory resources) these requirements can often be satisfied. This means that, for the first time in the history of C++, the containers and algorithms of the C++ standard library can be used in applications that require AUTOSAR Rule A18-5-5.
Vortrag Teilen
New MISRA C++ 202x are coming. This release will address modern C++ and thus is relevant not only for safety critical code in the automotive sector, but also for day-to-day C++ development. Expect the new MISRA rules to be less "miserable" for your day-to-day coding and use static analysis tooling to enforce them. Understand what kind of C++ will be considered unsafe, get examples of guidelines and learn which rules better to suppress in static analysis tools in non-safety-critical software.
Target Audience: Developers
Prerequisites: C++
Level: Advanced
Extended Abstract
New MISRA C++ guidelines are coming. In contrast to the previous release in 2008, MISRA C++ will address modern C++ as it is used in modern automotive systems. It is expected that other domains with safety critical software will incorporate MISRA C++ as well. In addition many of the rules, especially those supported by corresponding static analysis tools, can make your own C++ coding practices better. The talk briefly introduce the development of safety critical software, highlight some of the modern MISRA C++ rules applicable to all kinds of code and will also show corners of the rule set, better avoided for "normal" C++ code. The latter is important to know, when you are asked to retrofit your code to the output of a static analyzer tuned to MISRA-C++.
* History of MISRA C++ guidelines
* Peculiarities of software development for safety-critical systems
* Example guidelines and how they influence coding
* "strong stuff" that should not bother in normal C++
* Outlook on further revisions
Vortrag Teilen