This open-access course is directed at those who are already familiar with C and object-oriented programming towards a proficiency level of C++ programming. The course covers the basics of C++ programming and moves on to advanced C++ semantics and concepts.
Key features:
If you enjoy the course or you find it useful, please add a Star
TITLE | MAIN FOCUS | |
---|---|---|
1 | Introduction | History of C/C++, Areas of Applications, Course introduction |
2 | Basic Concepts I - Fundamental Types | Integral data types, floating-point, operators, and conversion |
3 | Basic Concepts II - Entities and Control Flow | Enumerators, structures, control flow statements |
4 | Basic Concepts III - Memory Management | Heap, Stack, pointers, references, const property, conversion operators |
5 | Basic Concepts IV - Functions and Preprocessing | Functions, lambda expressions, preprocessing directives |
6 | C++ Object Oriented Programming I | Class hierarchy, constructor, destructor, class keywords |
7 | C++ Object Oriented Programming II | Polymorphism, operators overloading |
8 | C++ Templates and Meta-programming I | Function template, type traits |
9 | C++ Templates and Meta-programming II | Class template, SFINAE |
10 | Translation Units | Dealing with multiple translation units and files, namespace |
11 | Code Conventions | Project organization and main code conventions |
12 | Ecosystem | Debugging, testing, building, documenting tools |
13 | Utilities | Main std libraries |
14 | Containers, Iterators, and Algorithms | Containers, iterators, algorithms |
15 | Advanced Topics | Move semantics, error handling, C++ idioms |
16 | Optimization I | Code optimizations, e.g. arithmetic, memory, etc. |
17 | Optimization II | Compiler optimizations, profiling and benchmarking tools |
2. Basic Concepts I - Fundamental Types
void
type, Pointer type and nullptr
auto
declaration<=>
size_t
, When use signed/unsigned integer? Promotion, Truncation, Undefined behaviorNaN
), Summary, Properties3. Basic Concepts II - Entities and Control Flow
struct
, Bitfield, union
if
Statement, for
Loop, Range-base for
loop, switch
, goto
4. Basic Concepts III - Memory Management
new
, delete
, Memory Leak&
, Referenceconst
, constexpr
, consteval
, constinit
static_cast
, const_cast
, reinterpret_cast
, Type punningsizeof
Operator5. Basic Concepts IV - Functions and Preprocessing
#
), #pragma
and #error
, Token-Pasting Operator (##
), Variadic Macro6. C++ Object Oriented Programming I
explicit
keyword= default
)this
, static
, const
, mutable
, using
, friend
, delete
7. C++ Object Oriented Programming II
virtual
methods, Virtual table, override
keyword, final
keyword, Common errors, Pure virtual method, Abstract class and interface[]
, Comparison operator <
, Spaceship operator <=>
Function call operator ()
, Conversion operator T()
, Return type overloading resolution, Increment and decrement operators ++
/--
, Assignment operator =
, Stream operator <<
, Operator Notes8. C++ Templates and Meta-programming I
auto
deductionstatic_assert
, decltype
Keyword, using
Keyword9. C++ Templates and Meta-programming II
friend
keyword, Dependent names, Template variablestatic
and extern
keywords, Internal/External linkage examples, Linkage of const
and constexpr
, Static Initialization Order Fiascoinline
functions/variablesextern
keywordextern
keyword#include
Issues: Forward declaration, Include guard, Circular dependencies, Common linking errorsstatic
methods, Namespace alias, Anonymous namespace, inline
namespacesrc/include
directories#include
gdb
)valgrind
, Stack protectionclang-tidy
cmake
and ctest
doxygen
clang-format
, Compiler Explorer
, Code transformation - CppInsights
, Code autocompletion - TabNine/Kite
, Local code search - ripgrep
, Code search engine - searchcode/grep.app
, Code exploration - SourceTrail
, Code benchmarking - Quick-Bench
, Font for Codingofstream/ifstream
std::string
, Conversion from/to numeric balues, std::string view
, std::format
<random>
, Seed, PRNG period and quality, Distribution, Quasi-randomstd::pair
, std::tuple
, std::variant
, std::optional
, std::any
14. Containers, Iterators, and Algorithms
std::array
, std::vector
, std::list
, std::deque
, std::forward_list
std::set
, std::map
, std::multiset
std::stack
, std::queue
, std::priority_queue
std::span
std::advance
, std::next
, std::prev
, std::distance
, Range access methods, Iterator traitsstd::find_if
, std::sort
, std::accumulate
, std::generate
, std::remove_if
lvalues
and rvalues
references, Move semantic, Compiler implicitly declared, std::move
&
, &&
Overloading - Ref-qualifiersconst
Correctnessnoexcept
keyword, Memory allocation issues, Alternative error handling approachesstd::unique_ptr
, std::shared_ptr
, std::weak_ptr
printf
, Memory Mapped I/O, Speed up raw data loadinggprof
, uftrace
, callgrind
, cachegrind
, perf
Linux profilerOnline compiler and execution: CompilerExplorer
If you find any typos, conceptual errors, or sections to improve, please report them by writing directly to me or by using the issue
panel
Federico Busato