---
# System prepended metadata

title: Modern C++ Programming
tags: [' data structure', ' algorithm', ' c++', computer science, ' leetcode']

---

---
title: Modern C++ Programming
tags: computer science, algorithm, data structure, leetcode, c++
---

<center>
    
# <font size = 6>Modern C++ Programming</font>
    
</center>

<center>
    
:::info
Location: TBD, 德田館
Time: TBA
:::
    
</center>

<br>
<br>
<div>
<p style="text-align: right">
    ``C++ is a beast that cannot be tamed completely.<br>But in its <font color = "red">complexities</font> lie its power.''<br>-- Bjarne Stroustrup
</p>   
</div>
<div>
<p style="text-align: right">
``C++'s power is directly proportional to its complexity.''<br>-- Alexander Stepanov
</p>   
</div>
<div>
<p style="text-align: right">
``The key to mastering C++ is to focus on the concepts<br>rather than getting lost in language technicalities.''<br>-- Scott Meyers
</p>   
</div>

## **Course Information**

The course aims to delve deep into the modern features and best practices of C++ programming, equipping students and professionals with the skills needed to develop efficient and robust applications using C++2x standards.

### Instructor
- Instructor name: 盧政良 (Zheng-Liang Lu, Arthur)
- Email address: arthurzllu@gmail.com

### Prerequisites
- Proficiency in C++, including concepts of loops, arrays, pointers, functions, and structures.
    - See also [APCS: C++ Programming](https://www.csie.ntu.edu.tw/~d00922011/cpp.html).
- Familiarity with other programming languages (Java or C#) is advantageous.
    - See also [Java Programming](https://www.csie.ntu.edu.tw/~d00922011/java.html).
    - See also [C# Programming](https://www.csie.ntu.edu.tw/~d00922011/csharp.html).

### Tech Stack
- C\+\+2x compatible with C++11, 14, 17, 20.
- Tool chains
    - Compilers: [GNU g++](https://gcc.gnu.org/) or [clang](https://clang.llvm.org/)
    - make, cmake
    - Debugger: gdb
    - Version control: git
    - [Linux kernel document](https://docs.kernel.org/admin-guide/README.html)

### Recording Classroom Lectures Policy
:::warning
Recording of classroom lectures is <font color="red">**prohibited**</font> unless advance written permission is obtained from the class instructor and any guest presenter(s).
:::

## **Syllabus**

### Introduction to C++2x
- Brief history and overview of C\+\+2x features
- Key features and advantages of C\+\+2x over C
- Basic syntax and data types in C\+\+2x
   
### Object-Oriented Programming
- Classes and objects
- Encapsulation and access specifiers (public, private, protected, and friend)
- Constructors and destructors
- Inheritance and polymorphism
- Virtual functions and pure virtual functions
    - Operator overriding
- Abstract classes and interfaces
- Annoymous function: lambda
- Using OOP to model real-world problems
    - Exception handling

### Templates and Standard Template Library (STL)
- Templates and generic programming
- Class templates and function templates
- Standard Template Library (STL): containers, iterators, algorithms
- Using STL containers and algorithms to solve common problems

### C++ Standard Library
- IOStream Library: input and output streams, stream manipulators
- String and character manipulation: string, char_traits, charconv
- Time and date manipulation: chrono, calendar, time_zone
- Filesystem Library: file and directory manipulation
    
### Memory Management
- Dynamic memory allocation and deallocation in C++
- Smart pointers: unique_ptr, shared_ptr, weak_ptr
- RAII (Resource Acquisition Is Initialization) pattern
- Handling memory leaks and other memory-related issues

### Design Patterns
- Creational patterns: singleton, factory method, abstract factory
- Structural patterns: adapter, bridge, proxy, decorator, sharing (interning, flyweight)
- Behavioral patterns: iterator, strategy, observer (publish/subscribe)
- Application: QunatLib

### C++ Boost Library
- Introduction to the Boost library
- Selecting and using relevant Boost components
    - Boost.Asio
- Boost integration with C++20 and embedded systems

### Multithreading Programming
- Basic concepts of operating systems (OS)
- Thread & Runnable
- Race condition, mutual exclusion & synchronized methods/blocks
- Producer-consumer problem (bounded-buffer problem) & semaphores
- Dining philosophers: deadlock, livelock, starvation
- High-level concurrency framework: thread pools, fork-join pools, asynchronous computation, concurrent data structures, atomic variables, synchronizers, monitor locks

## **Gradebook**

<center>
    
<iframe src="" width = "700px" height = "100px"></iframe>
    
</center>

## **References**

### ++C\+\+ Programming Language++
- Josh Lospinoso, [C++ Crash Course: A Fast-Paced Introduction](https://www.amazon.com/C-Crash-Course-Josh-Lospinoso/dp/1593278888), 2019
![](https://i.imgur.com/WsJQO1f.jpg =100x)
    - Official website: https://ccc.codes/
- [CppNow](https://www.youtube.com/@CppNow)
![image](https://hackmd.io/_uploads/H13ycdKvA.png =100x)
    
#### Object-Oriented Programming & Design Patterns

#### C++ Boost
- Boris Schäling, [The Boost C++ Libraries](https://theboostcpplibraries.com/), 2025
![image](https://hackmd.io/_uploads/S1O-PFkvWg.png =100x)
- Arindam Mukherjee, [Learning Boost C++ Libraries](https://www.amazon.com/Learning-Boost-Libraries-Arindam-Mukherjee/dp/1783551216), 2015
![image](https://hackmd.io/_uploads/HyecyNVPA.png =100x)

#### C++ STL
- John Farrier, [Data Structures and Algorithms with the C++ STL: A guide for modern C++ practitioners](https://www.amazon.com/Data-Structures-Algorithms-STL-practitioners/dp/1835468551), 2024
![image](https://hackmd.io/_uploads/ByIupQVv0.png =100x)

#### Concurrent Programming
- Rainer Grimm, [Concurrency with Modern C++](https://leanpub.com/concurrencywithmodernc), 2024
![image](https://hackmd.io/_uploads/SkPp6Q4PR.png =100x)

### ++Applications++

#### Linux Kernel Development
- https://www.kernel.org/
- https://github.com/torvalds/linux
- Jim Huang (黃敬群), [Linux 核心設計 (Linux Kernel Internals)](http://wiki.csie.ncku.edu.tw/linux/schedule), Department of Computer Science and Information Engineering, National Cheng Kung University

#### CUDA
- https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html
- Jaegeun Han and Bharatkumar Sharma, [Learn CUDA Programming](https://www.amazon.com/CUDA-Cookbook-Effective-parallel-programming/dp/1788996240), 2019
![image](https://hackmd.io/_uploads/BJzjnQVP0.png =100x)

#### QuantLib
- M. S. Joshi, [C++ Design Patterns and Derivatives Pricing](https://www.cambridge.org/tw/universitypress/subjects/mathematics/mathematical-finance/c-design-patterns-and-derivatives-pricing-2nd-edition), 2/e, 2008
![](https://i.imgur.com/DV4se18.png =100x)
- https://www.quantlib.org/

### MISC
- Martin Reddy, [API Design for C++](https://www.tenlong.com.tw/products/9780443222191), 2/e, 2024
![image](https://hackmd.io/_uploads/SJ8G7D1PZx.png =100x)
- Daniel Hanson, [Learning Modern C++ for Finance](https://www.oreilly.com/library/view/learning-modern-c/9781098100797/), 2024
![image](https://hackmd.io/_uploads/H16l4dywZe.png =100x)
- Dmytro Kedyk, [Implementing Useful Algorithms in C++](https://www.amazon.com/Implementing-Useful-Algorithms-Dmytro-Kedyk/dp/B08PXHJCXY), 2020
![image](https://hackmd.io/_uploads/Bkb7LdkwZx.png =100x)
- Aaron De la Rosa, [Mastering Quantitative Finance with Modern C++](https://link.springer.com/book/10.1007/979-8-8688-1793-9), 2025
![image](https://hackmd.io/_uploads/ryoB6OJvZx.png =100x)
- Bjarne Stroustrup, [Programming: Principles and Practice Using C++](https://www.amazon.com/Programming-Principles-Practice-Using-C-dp-0138308683/dp/0138308683), 3/e, 2024
![image](https://hackmd.io/_uploads/SJ998F1wZe.png =100x)
- William B. Birt, [C++23 Ultra-Low Latency Engines](https://blackwells.co.uk/bookshop/product/C23-Ultra-Low-Latency-Engines-by-William-B-Birt/9798242614086), 2026
![image](https://hackmd.io/_uploads/Bkx8PYkDZe.png =100x)
- Charles Whittaker, [Professional C++ Engineering: Principles, Patterns, and Pitfalls](https://www.amazon.com/Professional-Engineering-Principles-Development-Programming-ebook/dp/B0DXCGTBR6/), 2026
![image](https://hackmd.io/_uploads/Byk2DKJDZx.png =100x)