Every month, more embedded C projects switch to the C++ programming language. This trend is caused by the fact that C++ tends to be faster and provide much better and safer abstractions without sacrificing either the performance or ability to control underlying hardware.
Embedded development is a specific subject. In most cases, due to underlying small-factor physical architectures, embedded projects often can't use C++ exceptions and have problems with dynamic memory usage. That makes most parts of the C++ Standard Library unusable in that domain. Also, most C developers have a good understanding of pointer types, which is why pointers are heavily overused by them in the C++ code, causing many stability and security issues. Embedded engineers need to understand the basics of so-called Modern C++, which makes the language much friendlier, easier, and safer to use.
C++ is a big and complicated programming language, so it is often not easy for embedded C developers to master it. That training was built from the ground up with such an audience in mind. It covers only a common subset of Modern C++ and the features that can be used in embedded programming. It also addresses significant differences between C and C++ programming languages. Upon completing that training, every embedded engineer knows how to use C++ templates to create powerful abstractions that are easy and safe to use but hard to abuse.
This training should be considered mandatory training for all bare-metal C++ engineers and code architects.
TRAINING HIGHLIGHTS
- Emphasis on understanding the philosophy and mechanisms of C++ programming language and learning how to reuse this knowledge in own code
- A detailed description of the differences between C and C++ programming languages with the focus on the embedded development
- Particular focus on the usage of C++ templates in practical tasks
- Development of error-proof code
- Selection of useful patterns and techniques that prove in an embedded production code
TRAINING AGENDA
The following plan is an initial proposal for the training material. The final agenda is always created based on the individual pre-training analysis of the client's requirements and constraints.
- C++ Basics for Embedded Developers
- Identifiers and naming conventions
- Namespaces
- C++ types and their properties
- Value vs reference semantics
- Pointers vs references
- Unscoped vs scoped enumerations
- Classes and friends
- Special member functions
- Rule of Three, Five, and Zero
- Value categories
- Automatic type deduction
- Type conversions
- Objects
- Alignment
- Scope
- Lifetime
- ODR and inline
- Storage duration
- Stack vs Heap vs Free Store
- Customizing free store allocations
- Initialization
- Name lookup
- Overload resolution
- Customization points
- Range-based for loop
- Mixing C and C++
- Coding with performance in mind
- Things to avoid on a fast path
- Copy elision
- Move Semantics
- Ref-qualifiers
- noexcept
- constexpr
- Source code vs hardware - introduction
- Good practices and useful tools
- Lambda expression
- std::function
- Algorithms
- Pointless Pointers
- std::string_view
- std::span
- RAII
- Smart pointers
- std::optional
- std::variant
- std::expected
- std::tuple
- Introduction to C++ Templates
- Class, function, variable, and alias templates
- Implicit instantiation
- Template argument deduction
- Variadic templates
- Fold-expressions
- Dependent names
- Partial and Full specialization
- SFINAE overview