This repo is for Mastering C++ and Modern C++ Book
- What's Programming language
- First program
- Compilation Hello World
- Variables and Data Types
- Primitive types: int, char, float, double, bool
- Derived types: arrays, pointers, references
- User-defined types: structs, enums, classes
- Operators and Expressions
- Arithmetic operators: +, -, *, /, %
- Relational operators: ==, !=, >, <, >=, <=
- Logical operators: &&, ||, !
- Bitwise operators: &, |, ^, ~, <<, >>
- Assignment operators: =, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=
- unary operators (Increment and decrement): ++, --
- ternary operator: ?:
- Control Structures
- Conditional statements: if, if-else, nested if, switch-case
- Looping statements: for, for range, while, do-while
- Jump statements: break, continue, goto, return
- Introduction to Pointers
- Pointer declaration, initialization, and dereferencing
- Operations on Pointers
- References and reference variables
- Dynamic Memory Allocation
- new and delete operators
- Allocating memory for single variables and arrays
- Linked List
- Memory leaks and how to avoid them
- Smart Pointers
std::unique_ptrstd::shared_ptrstd::weak_ptr
- Function Declaration and Definition
- Syntax: return_type function_name(parameters)
- Function prototypes
- Default arguments
- Overloading and Inline Functions
- Function overloading
- Inline functions
- Recursive Functions
- Base case and recursive case
- Examples: factorial, Fibonacci sequence
- Parameter Passing
- Pass-by-value
- Pass-by-reference
- Pass-by-pointer
- Final project Linked List
- Append element
- Insert element
- Delete element
- Print element
- Macros
- #define, #undef
- Function-like Macro
- Conditional Compilation
- #ifdef, #ifndef, #if, #else, #elif, #endif
- Conditional compilation directives
- File Guards
- Preprocessing
- Compilation
- Assembly
- Linking
- Compiling many source files
- Classes and Objects
- Class definition and declaration
- Access specifiers: public, private, protected
- Member variables and member functions
- Object instantiation
- Constructors and Destructors
- Default constructor
- Parameterized constructor
- Copy constructor
- Destructor
- Inheritance
- Base and derived classes
- Types of inheritance: single, multiple, multilevel, hierarchical, hybrid
- Constructor and destructor calls in inheritance
- Polymorphism
- Compile-time polymorphism: function overloading, operator overloading
- Runtime polymorphism: virtual functions, pure virtual functions, abstract classes
- Encapsulation
- Data hiding
- Setter and Getter (Accessor and mutator functions)
- Abstraction
- Abstract classes and interfaces
- Virtual function and pure virtual function
- Operator Overloading
- Overloading unary and binary operators
- Overloading operators using member and friend functions
- Static Members
- Static member variables and functions
- Class-level data and behavior
- Multiple Inheritance
- Diamond problem and virtual inheritance
- Operator Overloading
- unary Overloading
- binary Overloading
- extraction and insertion Overloading
- Rules
- Rule of Three
- Final project Tic-Tac-Toe
- Function Templates
- Template syntax and usage
- Specialization of function templates
- Class Templates
- Template classes
- Specialization of class templates
- Containers
- Sequence containers: vector, list, deque, array
- Associative containers: set, map, multiset, multimap
- Unordered containers: unordered_set, unordered_map, unordered_multiset, unordered_multimap
- Container adaptors: stack, queue, priority_queue
- Iterators
- Input, output, forward, bidirectional, random access iterators
- Iterator functions: begin(), end(), rbegin(), rend()
- Algorithms
- Non-modifying: find, count, equal, search
- Modifying: copy, transform, swap, fill, replace, remove, unique
- Sorting and searching: sort, stable_sort, partial_sort, nth_element, binary_search, lower_bound, upper_bound, equal_range
- Function Objects
- Functors and their usage
- Predefined function objects in
<functional>
- try, catch, throw
- Syntax and usage
- Multiple catch blocks
- Catching all exceptions
- Standard Exceptions
- Hierarchy of standard exceptions
- Defining custom exceptions
- Streams
- Input/output stream classes: ifstream, ofstream, fstream
- Input/output operations
- File Operations
- Opening, closing files
- Reading from and writing to files
- Binary file operations
- Thread Management
- Creating and managing threads
- Joining and detaching threads
- Mutexes and Locks
- Mutual exclusion with std::mutex
- Locking mechanisms: std::lock_guard, std::unique_lock
- Condition Variables
- Synchronization with std::condition_variable
-
Using and Defining Namespaces
- Defining a namespace
- Using a namespace
- Nested namespaces
-
Lambda Expressions
- Basic lambda syntax
- Capturing variables by value and reference
- Lambda with parameters and return type
- Range-Based for Loop
- Lambda Expressions
- Smart Pointers
- Rvalue References and Move Semantics
- Static Assertions
- Variadic Templates
- nullptr Keyword
- Strongly-Typed Enums
- Thread Support Library
- Chrono Library
- New Standard Libraries
- Generic Lambdas
- Return Type Deduction
- Relaxed constexpr Restrictions
- Binary Literals
- std::optional
- std::variant
- std::any
- Structured Bindings
- if constexpr
- Inline Variables
- Filesystem Library
- Ranges
- Modules
- New Standard Libraries