cpp
This skill covers contemporary C++ practices from C++11 onward, emphasizing memory safety through smart pointers (unique_ptr, shared_ptr, weak_ptr) and the RAII pattern for automatic resource cleanup. You'll explore move semantics and perfect forwarding to optimize performance, dive into function and class templates with specialization techniques, and learn STL containers and algorithms for efficient data manipulation.
cpp teaches modern C++ patterns for memory management, resource safety, and performance optimization.
AI-generated summary based on this skill's SKILL.md
Install
miles990/claude-software-skills/cpp · repository language: TypeScript
git clone https://github.com/miles990/claude-software-skills
cp -r claude-software-skills/programming-languages/cpp ~/.claude/skills/cppFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What modern C++ programming patterns does cpp cover?
cpp teaches contemporary C++ practices from C++11 onward, with emphasis on memory safety through smart pointers (unique_ptr, shared_ptr, weak_ptr) and the RAII pattern for automatic resource cleanup. You'll learn move semantics, perfect forwarding, function and class templates with specialization, STL containers and algorithms, and advanced idioms for performance-critical systems code.
How does cpp handle C++ smart pointers and memory management?
cpp covers smart pointers including unique_ptr, shared_ptr, and weak_ptr for safe memory management without manual allocation/deallocation. The skill emphasizes the RAII (Resource Acquisition Is Initialization) pattern, scope guards, and best practices for automatic resource cleanup. You'll learn to avoid circular references and implement memory-safe designs in modern C++.
What does cpp teach about C++ templates and template specialization?
cpp explores function and class templates with specialization techniques, variadic templates, fold expressions, and the CRTP (Curiously Recurring Template Pattern). You'll master generic programming, constexpr evaluation, and C++20 concepts with requires clauses for compile-time programming and type-safe generic code.
Does cpp cover multithreading and concurrent programming?
Yes, cpp teaches multithreading in C++ using async, future, atomic operations, mutexes, and condition variables. You'll learn to implement efficient concurrent applications, build thread-safe data structures like queues, and apply synchronization patterns for safe multithreaded systems.
What STL and functional programming topics are in cpp?
cpp covers STL containers (vector, map, etc.), algorithms, lambda expressions with various capture modes, and generic lambdas with auto parameters. You'll master functional programming patterns, the remove-erase idiom, and efficient data manipulation techniques using modern C++ standard library features.
How does cpp address error handling and resource safety?
cpp teaches modern error handling using optional and variant types instead of exceptions in performance-critical code. Combined with RAII, smart pointers, and scope guards, these patterns ensure resources are properly managed and exceptions don't leak resources, providing robust and predictable error handling.
SKILL.md
rendered from the published skill — quoted content, verbatim
C++
Overview
Modern C++ (C++11 and beyond) patterns including RAII, smart pointers, templates, and STL.
Modern C++ Fundamentals
Smart Pointers
```cpp
include <memory>
include <iostream>
// unique_ptr - exclusive ownership class Resource { public: Resource() { std::cout << "Resource acquired\n"; } ~Resource() { std::cout << "Resource released\n"; } void use() { std::cout << "Resource used\n"; } };
void unique_ptr_example() { // Create unique_ptr auto ptr = std::make_unique<Resource>(); ptr->use();
// Transfer ownership
auto ptr2 = std::move(ptr);
// ptr is now nullptr
// Array support
auto arr = std::make_unique<int[]>(10);
}
// shared_ptr - shared ownership void
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 3 files
programming-languages/cpp/SKILL.md
programming-languages/cpp/templates/CMakeLists.txt
programming-languages/cpp/templates/README.md