Use when working with modern C++ codebases requiring features from C++11 to C++23 including lambdas, move semantics, ranges, and concepts.
View on GitHubTheBushidoCollective/han
jutsu-cpp
January 24, 2026
Select agents to install to:
npx add-skill https://github.com/TheBushidoCollective/han/blob/main/jutsu/jutsu-cpp/skills/cpp-modern-features/SKILL.md -a claude-code --skill cpp-modern-featuresInstallation paths:
.claude/skills/cpp-modern-features/# C++ Modern Features
Master modern C++ features from C++11 through C++23, including lambdas, move
semantics, ranges, concepts, and compile-time evaluation. This skill enables
you to write efficient, expressive, and maintainable modern C++ code.
## C++11 Features
### Auto Type Deduction
The `auto` keyword enables automatic type inference, reducing verbosity and
improving maintainability:
```cpp
// Traditional
std::vector<int>::iterator it = vec.begin();
std::map<std::string, std::vector<int>>::const_iterator map_it = mymap.find("key");
// Modern C++11
auto it = vec.begin();
auto map_it = mymap.find("key");
// Auto with initialization
auto value = 42; // int
auto pi = 3.14; // double
auto name = std::string("Alice"); // std::string
auto lambda = [](int x) { return x * 2; }; // lambda type
```
### Range-Based For Loops
Simplified iteration over containers and arrays:
```cpp
std::vector<int> numbers = {1, 2, 3, 4, 5};
// Traditional loop
for (std::vector<int>::iterator it = numbers.begin(); it != numbers.end(); ++it) {
std::cout << *it << " ";
}
// Range-based for (C++11)
for (int num : numbers) {
std::cout << num << " ";
}
// With references to modify elements
for (int& num : numbers) {
num *= 2;
}
// With const references for efficiency
for (const auto& str : string_vector) {
process(str);
}
```
### Lambda Expressions
Anonymous functions with capture capabilities:
```cpp
// Basic lambda
auto add = [](int a, int b) { return a + b; };
int result = add(3, 4); // 7
// Lambda with captures
int multiplier = 10;
auto multiply = [multiplier](int x) { return x * multiplier; };
// Capture by reference
int counter = 0;
auto increment = [&counter]() { counter++; };
// Capture all by value
auto func1 = [=]() { return x + y + z; };
// Capture all by reference
auto func2 = [&]() { x++; y++; };
// Mixed captures
auto func3 = [&sum, multiplier](int x) { sum += x * multiplier; };
// Mutable lambda (can modify captured va