m03-mutability

Community

Master C++ const safety and thread safety.

Author13eholder
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This skill teaches how to enforce const correctness and manage mutable state in C++ to prevent data races and preserve logical immutability, including locking strategies and proper use of mutable members.

Core Features & Use Cases

  • API Contracts: const methods guarantee no visible state modification.
  • Mutable State Management: design patterns for mutable caches guarded by synchronization primitives.
  • Thread-Safety Guidance: guidelines for when to use std::mutex or std::shared_mutex in API surfaces.
  • Use Case: implement a thread-safe cache inside a const method to balance performance and safety.

Quick Start

Construct a minimal class that demonstrates a const method safely accessing a mutable cache protected by a mutex.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: m03-mutability
Download link: https://github.com/13eholder/Modern-Cpp-Skills/archive/main.zip#m03-mutability

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.