Sie sind auf Seite 1von 6

C++ Internals

Duration: 3 days
Course Overview

This workshop is designed to provide participants with concepts, techniques and lessons
from experience that will help them be more successful in the C++ design and
programming.The greatest value from this course comes from the higher priorities given to
the depth of different subjects. Its perspective is that of the designer rather than that of the
programmer. The course is focused on design rather than diving deep into specifics.

Course Highlights
• C++ memory Internal

• Object Construction Internals

• Object Destruction Internals

• C++ Idioms

• Virtual function internals

• Exception internals

Course Coverage and Duration

This is a three-days intense course for developers and application architects.



Detailed course contents

Day 1
Object Initialization & Cleanup
• Compiler Synthesized Constructor & Destructor

• Constructor Internals

• Destructor Internals

• Deep copy v/s Shallow copy

• Explicit constructor
• Copy Constructor v/s Assignment operator

• Initialization v/s Assignment

• Order of Initialization

Day 2

Dynamic Memory Management


• Types of new operator

• Preventing Heap based objects

• Preventing Stack based objects

• Preventing destroying object instance

• Preventing object Instance

• Identifying object is on Heap or Stack

Virtual Functions
• Internals

• Dual Dispatching

• Casting Internals

• Object Slicing

• Virtual Inheritance

Exception Handling
• Exception Internals

• Resumption v/s Termination

• Exceptions in Constructor

• Exceptions in Destructor

• Object Slicing in Exceptions

Core language usability enhancements


• Initializer lists
• Uniform initialization

• Type inference

• Range-based for loop

• Lambda functions and expressions

• Explicit conversion operators

• Alias templates

• Variadic templates

• Multithreading model

• Static assertions

Lambda Expressions
• Why do we need this thing?

• Return type

• Lambda parameters

• Lambda body

• Storing lambdas

• std::function

• References to outside context

• Closures

Capturing in C++
• Capturing by reference

• Default capture modes

• Capturing class members

• Limitations of capturing

• Mutable lambdas

• Conversion to function pointers, nested lambdas, recursion

Template Features
• Variadic templates

• Working with parameter packs


• Traversing template parameter packs

• Constraining parameter packs to one type

• More places to expand a parameter pack

• Nested variadic templates

• One function template, two parameter packs

Template aliases
• Using using instead of typedef

• Closing angle brackets are officially allowed to tail-gate

• Local and unnamed types as template arguments

Class Features
• In-class initializers for non-static data members

• Delegating constructors

• Default methods

• Deleted methods

• override and final

Day 3

Move Semantics and Rvalue References
• Lvalue/rvalue revision

• const attribute .

• Reference initialization

• Rvalue references

• Move semantics implementation .

• Moving members .

• std::move

Perfect Forwarding
• The forwarding problem and solution .

• Reference collapsing and templates involving rvalue reference arguments .


Concurrency Support: Synchronization
• Mutexes .

• Timed mutexes .

• Locking multiple mutexes .

• Locks .

• call_once .

• Condition variables .

• Limiting wait time .

• Other lockable types .

• notify_all_at_thread_exit .

CPP new Features


• Structured Bindings

• if and switch with Initializers

• Inline Variables

• Aggregates with base classes

• Mandatory RVO, copy elision, and materialization

• Nested namespaces syntax

• static_assert() with one argument

• Lambda improvements (constexpr support, capturing *this)

• #__has_include

• New defined expression evaluation order

• Relaxed enumeration initialization

• Fixes for list initialization with auto

• noexcept as part of the function type

• new/delete with over-aligned data

• UTF-8 character literals

• Hexadecimal floating-point literals


• New attributes ([[nodiscard]], [[fallthrough]], and [[maybe_unused]])

• Attributes extensions

Template Improvements:
• Class Template Argument Deduction

• Deduction Guides

• Compile-time if (constexpr if)

• Fold expressions

• Extending fold expressions

• Pack expansion in using declarations

• Non-type template parameters with placeholders (auto/decltype(auto))

• Type traits improvements

o New type traits

o Type Traits suffix _v

o Combining Type Traits

• std::void_t and std::bool_constant

• Variable Templates with Placeholders (auto/decltype(auto))

Library Types
• std::optional<>

• std::variant<>

o Polymorphism with std::variant<>

• std::any

• std::byte

• std::string_view

o Designing/adopting interfaces for string and string_view

Das könnte Ihnen auch gefallen