Modern C++ with 11/14

Course Description:

Learning the C++ programming language is one thing, but learning to use it effectively and appropriately in a
real-time software development environment is another. For many programmers, these skills are untouched learned the hard way, through trial and error on the job.

Duration: 3 Days

Course Objectives:

  • To provide an understanding of the core essentials of the C++ programming
  • To give you detail exposure of writing C++ for challenging C++ software systems
  • To explain the capability and limitations under C++ standards
  • To explain the extension under C++ standards TR11/14

Pre-requisites:

  • Experience of programming using C
  • Prior knowledge of C++ programming is assumed with following topics
    • Basic Features of C++
    • C styled program in C++, OOPS – concept
    • Should be able to design and write class/methods
    • Should be comfortable at using pointers, references,
    • Programming with conversion by constructor/function
    • Static and dynamic overloading, inheritance
    • Type check, namespaces, cast operators and usage

Who Should Attend:

  • The course is designed for engineers who are embarking on projects using C++ and needs to update
    themselves with extended features.

Delegates will learn:

  • The core C++ features, syntax and semantics
  • The core C++ object implementation and usage
  • About memory and performance issues associated with C++
  • How complex data services can be handled using templates
  • Some of the recent features of C++ 11/14

Training Methodology:

  • This course is Instructor Led Training (ILT) and is achieved through both lecture with presentations,
    demonstration and some hands-on experience with roughly 60-70% presentation and 40-30% hands on.

Infrastructure (including Lab (for hands-on)) requirements:

  • An internet ready laptop/workstation with high-end configuration (Intel Core i5 or above with at least 4 GB of RAM) is recommended, with windows or macOS with pdf readers.
  • Latest Virtual Box preferred to be pre-Installed on their respective OS. One can visit
    https://www.virtualbox.org/wiki/Downloads and choose their HOST (OS) specific package.
  • Participants must ensure that at least 40 GB of free disk-space is available on their laptops/workstations – as this is required for installing a pre-configured Linux setup as a Virtual Box appliance for hands-on practice session in this training program.
  • The speaker/ trainer would carry the preinstalled Linux disk image with GNU Tool chain preinstalled
  • Participants can also choose to work on an existing Linux environment accessible to them with support for root access and ability to install/remove software.
  • Whiteboard, markers and scribble pads + pens for participants.
  • A high-resolution (1024×768 or above) LCD Projector with support to connect to trainer’s laptop
    (Apple MacBookPro/Win/Linux).

Detailed Course coverage (Day wise)

Day-1

Session 1 – Topic: Introduction to core C++

  • C++ Timeline
  • Features of C++ (Revision)
  • Goals for C++ and TR11/14/17
  • Extended Features snapshot

Session 2 – Topic: OOAD: C++ Object Implementation (3.0 hours)

  • MDD, UML view, OOAD, SOLID
  • How a compiler interprets Object
  • Special member functions, Constructors, Destructors, Copy Constructor, Assignment Operator
  • Blocking Object Copying
  • Designing a class around mutable, logical const

Session 3 – Topic: Object Initialization & Cleanup

  • Compiler Synthesized Constructor & Destructor
  • Deep copy v/s Shallow copy
  • explicit constructor
  • Copy Constructor v/s Assignment operator
  • Initialization v/s Assignment
  • Order of Initialization
  • Aggregate initialization

Session 4 – Class Members and Designing Software

  • Singleton Classes

Offline Exercises

  • Code Base to analyze OOPS/OOAD (Will be shared to the participants on google drive/git)

Day-2

Session 1 – Topic: Virtual Functions (1.0 Hours)

  • Internals
  • Casting Internals
  • Object Slicing
  • Virtual Inheritance Case study on VTABLE

Session 2 – Topic: Runtime type identification (0.5 hours)

  • Introduction
  • Making Do Without RTTI
  • RTTI constituents, cast operators
  • The Cost of Runtime Type Information

Session 3 – Topic: Exception Handling in C++ (0.5 hours)

  • No_throw
  • Exception support in C++ (try/throw/catch)
  • set unexpected

Session 4 – Templates in C++ (2.0 hours)

  • Understand the design of STL/STD/Allocator
  • Generic class
  • Class Template Full specialization
  • Class Template Partial specialization
  • Template with friend, inheritance
  • Designing your containers and adding functionalities to it
  • Template to template as holder object

Session 5 – Using STL/STD Containers

  • Using Algorithm and iterators with STD
  • Exploring various containers
  • Vector, List, Map, Set
  • Array, tuple, unordered_map, unordered_set

Session 6 – Larger Language Features

  • Initialization, Initializer lists
  • Uniform initialization
  • Move Semantics
  • Lambda

Offline Exercises

  • Code Base to analyze templates/STL/STD (Will be shared to the participants on google drive/git)

Day-3

Session 1 – Topic: Core Language Feature Extensio

  • Auto, decltype, trailing return type
  • auto vs. decltype
  • Range-based for loop
  • static_assert
  • noexcept
  • extern template
  • Variadic templates
  • constexpr functions/data
  • Inline namespaces

Session 2 – Topic: Features Specific to Class Design (1.0 hours)

  • Generated functions: =default / =delete
  • Override control: override / final
  • Delegating constructors
  • Inheriting constructors

Session 3 – Concurrency in C++ (2.5 hours)

  • STD Threads
  • Passing arguments to threads
  • Data lifetime considerations
  • Synchronization with mutexes and locking
  • Acquiring multiple locks
  • mutex types
  • Returning values from threads using futures and async
  • Launch policies
  • Querying future status
  • Condition variables
  • Thread-local storage
  • Atomics

Session 4 – Smart Pointers (0.5)

  • std::unique_ptr, std::shared_ptr, std::make_shared/std::make_unique

Session 5 – Optimizing your code & Modern C++ Guidelines

  • Introduction & CERT
  • Coding practices

Session 6 – Online References, books, and Modern C++ Code references (0.5 hours),

  • Revision & FAQ

Offline Exercises

  • Code Base to analyze Threads/TR11/T14