Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 2 KB

File metadata and controls

14 lines (11 loc) · 2 KB

Advanced C++ Examples

This section delves into more complex and nuanced C++ topics, essential for writing robust, efficient, and modern C++ code.

  1. Templates (Function and Class) - Explores generic programming with function templates (e.g., generic add, printArray) and class templates (e.g., generic Container), including basic template specialization.
  2. Advanced STL - Algorithms - Demonstrates common STL algorithms such as for_each, find, count_if, transform, copy, remove_if (with erase-remove idiom), and sort, often using lambda expressions.
  3. Advanced STL - Other Containers - Briefly introduces std::list, std::deque, and std::priority_queue, highlighting their characteristics and basic operations.
  4. Exception Safety Guarantees - Discusses and illustrates no-safety, basic guarantee, and strong exception safety guarantee (commit-or-rollback) with examples.
  5. RAII Beyond Pointers - Shows Resource Acquisition Is Initialization (RAII) applied to resources like file handles (FileHandler) and mutex locks (MutexGuard), ensuring proper cleanup.
  6. Move Semantics and Rvalue References - Covers rvalue references, move constructors, move assignment operators (std::move), and perfect forwarding, crucial for performance optimization.
  7. Concurrency Basics - Introduces C++ concurrency with std::thread, std::mutex, std::lock_guard, std::unique_lock, std::async, std::future, std::promise, and std::atomic.
  8. Modern C++ Features - Showcases a selection of modern C++ features including advanced lambdas (generic, this capture, mutable), auto and decltype, constexpr functions, and std::optional (C++17).

Refer to the main repository README for compilation instructions and overall project structure.