C++ Course Outline and Planning
This document outlines topics to cover, problems to assign, and resources to incorporate into the C++ course.
Core C++ Topics to Cover
1. Template Specialization
Priority: High
Description: Full and partial template specialization techniques
Prerequisites: Templates, generics
Resources:
- See topics/cpp-fundamentals/templates.md
- Add examples in code-examples/
2. lvalue, rvalue, and Move Semantics
Priority: High
Description: Understanding value categories and move semantics in modern C++
Topics to Cover:
- lvalue vs rvalue
- Move constructors
- Move assignment operators
- std::move and std::forward
- Perfect forwarding
Prerequisites: Rule of Three, references, pointers
Related Topics: Rule of Five
3. Smart Pointers
Priority: High
Description: Modern C++ memory management with smart pointers
Coverage:
std::unique_ptr- Exclusive ownershipstd::shared_ptr- Shared ownershipstd::weak_ptr- Non-owning references- Custom deleters
- Performance considerations
Prerequisites: Pointers, RAII, destructors
Resources:
4. Scoped Enums (enum class)
Priority: Medium
Description: Type-safe enumerations in modern C++
Example:
// Traditional enum (unscoped)
enum Color { black, white, red };
// Scoped enum (enum class)
enum class Color { black, white, red };
Color c = Color::red; // Requires scope resolution
auto white = false; // OK - white is now scoped
Advantages:
- Type safety
- No implicit conversions
- Scoped names (avoid naming conflicts)
5. Member vs Non-Member Functions
Priority: Medium
Description: When to use member functions vs non-member functions
Topics:
- Friend functions
- Operator overloading best practices
- Interface design principles
Example:
struct Base {
virtual void hi() { cout << "a"; }
};
struct Derived : Base {
void hi() override { cout << "b"; }
};
void foo(Base &b) {
b.hi(); // Polymorphic call
}
int main() {
Derived x;
foo(x); // Outputs: b
Base y;
foo(y); // Outputs: a
}
LeetCode Problems to Assign
Dynamic Programming
- Combination Sum IV
- Difficulty: Medium
- Topics: DP, recursion, memoization
- Ways to Express an Integer as Sum of Powers
- Difficulty: Medium
- Topics: DP, backtracking
Design Problems
- Design a Text Editor
- Difficulty: Hard
- Topics: Data structures, string manipulation
- Skills: Class design, implementation
- Design an ATM Machine
- Difficulty: Medium
- Topics: OOP, design patterns
- Skills: State management, operations
- Finding MK Average
- Difficulty: Hard
- Topics: Data structures, design
- Skills: Efficient data structure design
- Design Parking System
- Difficulty: Easy
- Topics: OOP basics, simple design
- Skills: Class design fundamentals
- Data Stream as Disjoint Intervals
- Difficulty: Hard
- Topics: Intervals, data structures
- Skills: Complex data structure design
Already Assigned
- Design Circular Queue (Lecture 10/22)
- LeetCode Link
- Status: Completed in class
Video Resources
Primary Course Videos
- C++ Programming Playlist
- Main course lecture recordings
- Follow chronologically
Supplementary Videos
- Mike Shah’s C++ Course
- Additional explanations
- Alternative teaching approach
- Additional C++ Resources
- Advanced topics
- Special subjects
Code Examples to Add
1. Virtual Functions and Polymorphism
Priority: High
#include <iostream>
using namespace std;
struct Base {
virtual void hi() { cout << "a"; }
};
struct Derived : Base {
void hi() override { cout << "b"; }
};
void foo(Base &b) {
b.hi();
}
int main() {
Derived x;
foo(x); // Outputs: b (polymorphic)
Base y;
foo(y); // Outputs: a
}
Location: code-examples/oop/virtual-functions.cpp
2. Move Semantics Example
Priority: High
#include <utility>
#include <vector>
class MyClass {
std::vector<int> data;
public:
// Move constructor
MyClass(MyClass&& other) noexcept
: data(std::move(other.data)) {}
// Move assignment
MyClass& operator=(MyClass&& other) noexcept {
data = std::move(other.data);
return *this;
}
};
Location: code-examples/advanced/move-semantics.cpp
3. Smart Pointer Examples
Priority: High
#include <memory>
void uniquePtrExample() {
auto ptr = std::make_unique<int>(42);
// Automatic cleanup
}
void sharedPtrExample() {
auto ptr1 = std::make_shared<int>(42);
auto ptr2 = ptr1; // Reference count = 2
}
Location: code-examples/advanced/smart-pointers.cpp
Books and References
Recommended Reading
- Scott Meyers Books
- Effective C++
- More Effective C++
- Effective Modern C++
- Bjarne Stroustrup
- The C++ Programming Language
- Programming: Principles and Practice Using C++
Course Structure Recommendations
Week 1-4: Fundamentals
- Basic syntax, data types
- Control structures
- Functions and parameters
- Arrays and pointers
Week 5-8: Object-Oriented Programming
- Classes and objects
- Constructors and destructors
- Inheritance
- Polymorphism
- Rule of Three
Week 9-12: Advanced Topics
- Templates
- STL (containers, algorithms, iterators)
- Smart pointers
- Move semantics
- Exception handling
Week 13-15: Modern C++ and Projects
- C++11/14/17 features
- Design patterns
- Final project work
- Code review and best practices
Topics for Future Expansion
C++11/14/17/20 Features
- constexpr
- auto and decltype
- Range-based for loops
- Lambda improvements
- Variadic templates
- std::optional, std::variant, std::any
- Concepts (C++20)
- Ranges (C++20)
- Modules (C++20)
Advanced Topics
- Multithreading and concurrency
- Template metaprogramming
- Compile-time programming
- Memory models
- Custom allocators
Practical Skills
- Build systems (CMake, Make)
- Debugging techniques
- Profiling and optimization
- Unit testing frameworks
- Version control best practices
Implementation Notes
Slide Updates Needed
- Add template specialization examples
- Include move semantics diagrams
- Expand smart pointer coverage
- Add scoped enum examples
- Include more C++11/14/17 features
See slides/SLIDE_UPDATES.md for detailed recommendations.
Assignment Ideas
- LRU Cache implementation (already assigned)
- Custom smart pointer implementation
- Template-based data structures
- Move-aware container class
- Design pattern implementations
Last Updated: January 2026
Course: CPP-S26
Maintainer: Course Instructor