AdvanceCPP TOC PDF
AdvanceCPP TOC PDF
Abhijit Bhattacharjee
2016
Contents
1 Prerequiste 5
1.1 Windows/Linux/Solaris Bare Metal with 8 GB Ram and 10 GB
Free Space ............................................................................................... 5
1.2 Decide on Development Platform - Windows/Linux(Flavour)/Oracle
Solaris .................................................................................................5
1.3 Github Profile for Each Candidate ......................................................5
1.4 Install Virtualbox.................................................................................... 5
2 DAY 1 5
2.1 System Setup and Introduction.............................................................. 5
2.2 Quick Overview of C++ ......................................................................5
2.3 What’s new in C++11 and C++14 ....................................................... 5
2.4 Tea Break ...........................................................................................5
2.5 Setup GitHub.......................................................................................5
2.6 Lunch Break ........................................................................................... 5
2.7 Motivation to migrated to C++11 ........................................................5
2.8 Agenda and Features to be covered ....................................................... 5
2.9 STL vs C++ Standard Library vs Boost .............................................5
2.10 Tea Break ...........................................................................................5
2.11 Continue Troubleshooting............................................................................ 5
2.12 Review Agenda with Expectations ......................................................5
2.13 Exercise ................................................................................................... 5
2.13.1 Introduction of Problem (DeDup): Implement a thread-
safe Client Server DeDup Application
.................................................................................................5
3 DAY 2 5
3.1 Review of Basic Concepts ...................................................................... 5
3.1.1 Object, Scope, Lifetime and Values ................................................ 5
3.1.2 Declarations, Definitions and One Definition Rule ..................5
3.1.3 Data Types.................................................................................. 5
3.2 Language Features: ...................................................................................... 5
1
C++ Advance Training Schedule 2
4 DAY 3 5
4.1 Review of Basic Concepts ...................................................................... 5
4.1.1 Deducing a Type: auto and decltype() .....................................5
4.1.2 Pointers, Arrays, and References .............................................5
4.2 Language Features: ...................................................................................... 5
4.2.1 Move semantics and lvalue, gvalue, xvalue, rvalue, and
prvalue references ........................................................................ 5
4.2.2 Deducing a Type: auto and decltype() .....................................5
4.3 Lunch Break........................................................................................5
4.4 Standard Library..................................................................................5
4.4.1 Containers library ....................................................................5
4.4.1.1 Associative containers ..................................................... 5
4.4.1.2 Unordered associative containers ................................... 5
4.4.1.3 Sequence containers ........................................................ 5
4.5 Lunch Break ........................................................................................... 5
4.6 Tea Break ...........................................................................................5
4.7 Exercise ................................................................................................... 5
4.7.1 Modify the parser to convert strings to numbers...................... 5
4.7.2 Implement Bag in C++ ............................................................5
5 DAY 4 5
5.1 Review of Basic Concepts ...................................................................... 5
5.1.1 control of defaults: default and delete ......................................... 5
5.1.2 control of defaults: move and copy ............................................. 5
5.1.3 delegating and inheriting constructors ......................................... 5
5.1.4 default member initialization ....................................................... 5
5.2 Language Features: ...................................................................................... 5
5.2.1 Lambda Expression, Capturing and Currying. Equivalence
with Functors .................................................................................. 5
5.3 Lunch Break ........................................................................................5
5.4 Standard Library..................................................................................5
5.4.1 Containers library ....................................................................5
5.4.1.1 Container adaptors .....................................................5
5.4.1.2 Thread safety of Container Libraries ........................... 5
5.4.2 STL Algorithms .......................................................................... 5
5.4.2.1 Nonmodifying Sequence Algorithms ........................... 5
5.4.2.2 Modifying Sequence Algorithms ................................. 5
5.4.2.3 Sorting and Searching ..................................................... 5
5.4.2.4 Min and Max ............................................................... 5
5.5 Exercise ................................................................................................... 7
5.5.1 Implement DeDup using Bag ...................................................... 7
6 DAY 5
6.1 Review of Basic Concepts ...................................................................... 5
6.1.1 Namespace and Type Aliase ....................................................... 5
6.1.2 Name Lookup .............................................................................. 5
6.2 Language Features: ...................................................................................... 5
6.2.1 Smart Pointers ............................................................................ 5
6.3 Lunch Break ........................................................................................5
6.3.1 C++ templates ..................................................................... 5
6.3.1.1 Class template - Function template ...........................5
6.3.1.2 Class member template ................................................ 5
6.3.1.3 Template argument deduction ....................................5
6.3.1.4 Explicit and Partial specialization .............................5
6.4 F-bounded quantification ....................................................................... 5
6.5 Exercise ................................................................................................... 7
6.5.1 Make the Bag implementation Generic ....................................... 7
7 DAY 6
7.1 Review of Basic Concepts ...................................................................... 5
7.1.1 Narrowing (how to prevent it) ..................................................... 5
7.1.2 Exception propagation ................................................................ 5
7.2 Language Features: ...................................................................................... 5
7.2.1 C++11 Memory Model ............................................................5
7.2.2 Thread Local Storage ...................................................................5
7.3 Lunch Break ........................................................................................... 7
7.3.1 Concurrency ................................................................................ 5
7.3.1.1 Atomics ............................................................................ 5
7.3.2 Threads and Tasks.......................................................................... 5
7.3.2.1 Threads ......................................................................5
7.3.2.1.1 C++11 Threads ...........................................5
7.3.2.1.2 WinThread ..................................................6
7.3.2.1.3 POSIX Thread ............................................6
7.3.2.2 Avoiding Data Races.................................................... 6
7.3.2.2.1 Mutual exclusion ........................................... 6
7.3.2.2.2 Generic mutex management ........................6
7.3.2.2.3 Generic locking algorithms ............................. 6
7.3.2.3 Task-Based Concurrency .............................................. 6
7.3.2.3.1 Futures.............................................................. 6
7.3.2.3.2 Promises ........................................................ 6
7.4 Exercise ................................................................................................... 7
7.4.1 Threadsafe Implementation of Bag ..........................................7
8 DAY 7 7
8.1 Review of Basic Concepts ...................................................................... 5
8.1.1 Unicode Support .......................................................................... 5
8.1.1.1 Strings library ................................................................. 5
8.1.1.2 Localization library ......................................................... 5
8.1.1.3 Input/output library ......................................................... 5
8.2 Language Features: ...................................................................................... 5
8.2.1 attributes ....................................................................................... 5
8.2.2 C99 features .................................................................................. 5
8.2.3 suffix return type syntax ................................................................. 5
8.3 Lunch Break .......................................................................................7
8.4 C++11 Regular Expressions ................................................................... 7
8.4.1 Introduction and Basic concepts .................................................. 7
8.4.2 Flavors of Regex ......................................................................... 7
8.4.3 Quantifiers .................................................................................. 7
8.4.4 Main classes ................................................................................ 7
8.4.4.1 basic_regex ................................................................... 7
8.4.4.2 sub_match ..................................................................7
8.4.4.3 match_results................................................................ 7
8.4.5 Algorithms................................................................................... 7
8.4.6 Iterators......................................................................................... 7
8.4.7 Exceptions..................................................................................... 7
8.4.8 Traits ............................................................................................ 7
8.5 Tea Break ................................................................................................ 7
8.5.1 Finish the Exercise ..................................................................7
9 DAY 8 7
9.1 Review of Basic Concepts ...................................................................... 5
9.1.1 PODs (generalized) .................................................................... 7
9.1.2 Uniform Initialization .................................................................. 7
9.2 Language Features: ...................................................................................... 5
9.2.1 Extended integer types.................................................................... 5
9.2.2 in-class member initializers ............................................................. 7
9.2.3 extern templates ............................................................................. 7
9.2.4 user defined literals ........................................................................ 5
9.3 Lunch Break .......................................................................................7
9.4 Utilities ................................................................................................... 7
9.4.1 Random Number Generators ....................................................... 7
9.4.2 Time utilities ............................................................................... 7
9.5 Variadic Templates
9.6 Tea Break ................................................................................................ 7
Finish the Exercise ..................................................................7
10 DAY 9 7
10.1 Review of Basic Concepts ...................................................................... 5
10.1.1 Removed and Deprecated Features (Overview) ......................... 5
10.1.2 Alignment control (i.e., alignof, alignas, etc) ............................. 5
10.2 Language Features: ...................................................................................... 5
10.2.1 Tuples ........................................................................................... 5
10.2.2 Fixed-Size Arrays .................................................................. 7
10.2.3 Generalized Functors and Binders .............................................. 7
10.3 Lunch Break .......................................................................................7
10.4 Metaprogramming with Type Traits ...................................................................7
10.5 Numeric operations (new in C++11) ...................................................................5
10.6 Input/output library(new in C++11) ....................................................................5
10.7 Compile time rational arithmetic ........................................................................5
10.8 Localization library(new in C++11) ....................................................................5
10.9 Tea Break ................................................................................................ 7
10.9.1 Finish the Exercise ...................................................................... 7
11 DAY 10 7
11.1 Review of Doubts
11.2 Shop specific contextual questions
11.3 Review of Exercises
11.4 What’s new in C++17) .................................................................................5
11.5 Further Reading and References) 5
12