fronius2020-08
Kursbegleitende Seite zur Schulung C++FOR
bei Fa. Fronius, Wels, 31. August bis 3. September 2020
Kurszeiten:
- Beginn 9:00 Ende 17:00
- Mittagspause von 11:00 bis 11:45 (Montag bis 12:00)
Links zu den verwendeten Online-Compilern:
- für "Single Source File" Demos: https://godbolt.org (Compiler Explorer)
nützlich auch für den Vergleich des Assembler-Code für kleine Variationen - für die durchlaufende Übung: https://onlineGDB.com (Online GDB)
ermöglicht einfache Projekte aus mehreren Source Files und Debuggen
Infographiken:
- Virtuelle Member-Funktionen und Laufzeit-Typinformation
- Multiple Inheritance Details (Besonderheiten bei "Diamand-Shaped" Inheritance)
- Inheritance and Memory Layout (Hardwarenahe Betrachtung virtueller Basisklasse)
- IO-Stream Basics
- Extension-Points (Vergleich virtuelle Member Funktionen und via C++-Templates)
- Exception Basics
- Exception Details
- Type-Based Branching (Vergleich `type_id` mit `dynamic_cast`)
- Smart Pointer
- Template Basics
- Template "Code Bloat"
- Template Example
- ...
Demo-Beispiele im Compiler Explorer
- https://godbolt.org/z/Pheb3P (Lambdas zum Suchen -- meist STL)
- https://godbolt.org/z/qEYesK (Lamdas zum Sortieren -- meist STL)
- https://godbolt.org/z/c8jx3K (Lambdas für komplexe Initialisierungen)
https://godbolt.org/z/3h6cx4 (wie zuvor zusätzlich static_assert und type_traits - https://godbolt.org/z/dhq7Y8 (Lambdas für Zusammenfassung von Abschnitten)
- https://godbolt.org/z/K9ohzb (Lambas mit notwendigem explizitem return Typ)
- https://godbolt.org/z/rbGzrj (std::function Kompatibilität zu callables)
- https://godbolt.org/z/fc487W (std::function / Publisher-Subscriber Quick Prototyp)
- https://godbolt.org/z/nGjn3a (korrigierte Version des obigen)
- https://godbolt.org/z/Tsnezx (Vergleich der beiden letzten Versionen)
- https://godbolt.org/z/zxcEoM (std::bind in verschiedenen Varianten)
- https://godbolt.org/z/navzxc (`std::accumulate` mit zwei threads)
- https://godbolt.org/z/jhWKKa (`std::accumulate` mit 4 worker threads und mutex)
- https://godbolt.org/z/sc545q (`std::accumulate` mit 4 worker threads und lockguard)
- https://godbolt.org/z/qW34b3 (`std::accumulate` mit 4 worker threads "lock-free")
- xxx (Condition Variable !!!!)
- https://godbolt.org/z/jE68Ya (zwei Beispiele zur Template-Programmierung)
- ...
Weitere Links:
- https://youtu.be/IqVZG6jWXvs?t=163 (Scott Meyers zu `std::move` and `std::forward`)
- https://www.amazon.com/Coding-Standards-Rules-Guidelines-Practices/dp/0321113586 (101 C++ Guidelines)
- https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines (C++ Core Guidelines)
- https://isocpp.org/wiki/faq/coding-standards (ISO-Cpp C++ FAQ)
- https://resources.sei.cmu.edu/downloads/secure-coding/assets/sei-cert-cpp-coding-standard-2016-v01.pdf (CERT C++ Guidelines)
- https://google.github.io/styleguide/cppguide.html (Google C++ Guidelines)
- ...
- Erste Übung (Ausgangsmaterial):
https://onlinegdb.com/HylOLVcQv (chose "fork" to edit) - Erste Übung (Lösung):
https://onlinegdb.com/B1sH7ScQv - Erste Übung (erweiterte Lösung)
https://onlinegdb.com/Hk3JMS57P
- Zweite Übung (Ausgangsmaterial, wenn nicht Ihre vorherige Lösung):
https://onlinegdb.com/B1sH7ScQv (chose "fork" to edit) - Zweite Übung (Lösung): https://onlinegdb.com/Byf-Or9mw
- Zweite Übung (erweiterte Lösung): https://onlinegdb.com/Hk5O8B57P
- Dritte Übung (Ausgangsmaterial, wenn nicht Ihre vorherige Lösung):
https://onlinegdb.com/r1iK_BomP (chose "fork" to edit) - Dritte Übung (Lösung):
https://onlinegdb.com/BJcrl95mD
- Vierte Übung (Ausgangsmaterial, wenn nicht Ihre vorherige Lösung):
https://onlinegdb.com/S1IJMFoQv (chose "fork" to edit) - Vierte Übung (Lösung)
https://onlinegdb.com/S1sJNYomP - Vierte Übung (erweiterte Lösung)
https://onlinegdb.com/B1SkH9j7D
- Fünfte Übung (Ausgangsmaterial, wenn nicht Ihre vorherige Lösung):
https://onlinegdb.com/S1sJNYomP (chose "fork" to edit) - Fünfte Übung (Lösung)
https://onlinegdb.com/BJqfO5i7w - Fünfte Übung (erweiterte Lösung)
https://onlinegdb.com/BkiOh9oQP
- Sechste Übung (Ausgangsmaterial, wenn nicht Ihre vorherige Lösung):
https://onlinegdb.com/BJqfO5i7w (chose "fork" to edit) - Sechste Übung (Lösung)
https://onlinegdb.com/SkYQ1siQv - Sechste Übung (erweiterte Lösungen)
https://onlinegdb.com/r1elCijmv
yyy
yyy
- Siebte Übung (Ausgangsmaterial, wenn nicht Ihre vorherige Lösung):
https://onlinegdb.com/HJgueDa27P (chose "fork" to edit) - Siebte Übung (Lösung)
https://onlinegdb.com/By0Bl137w
- Achte Übung (Ausgangsmaterial, wenn nicht Ihre vorherige Lösung):
https://onlinegdb.com/BJWatr0QP (chose "fork" to edit) - Achte Übung (Lösung)
https://onlinegdb.com/B1nIbLCQP
- Extra-Übung zu State-Machine
- https://godbolt.org/z/EdER68 (Statemachine wie in BASICS-35...46)
- godbolt.org/z/x39e9T (wie zuvor mit kleineren Verbesserungen)
- https://godbolt.org/z/b7voG4 (mit Tabelle als `unordered_multimap`)
- https://godbolt.org/z/4TcYz1 (mit je einer Tabelle pro State)