классы, объекты, владение ресурсамиclasses, objects, resource ownership

ООП в C++in C++

Базовый набор концепций ООП плюс полиморфизм (конструкторы, наследование, полиморфизм, поля, члены типа и другие — из 14 базовых убраны свойства и события, которых в C++ нет как отдельной языковой конструкции) плюс то, что делает C++ особенным: RAII, Rule of 0/3/5, виртуальные таблицы, слайсинг. Дополняет kb/oop_cpp.md (шпаргалка по SOLID и владению) страницами того же формата, что stl/ и algorithms/. Все 17 карточек заполнены.The baseline OOP concept set plus polymorphism (constructors, inheritance, polymorphism, fields, type members, and more — 2 of the 14 baseline concepts, properties and events, are omitted since C++ has no distinct language construct for them) plus what makes C++ distinctive: RAII, the Rule of 0/3/5, vtables, slicing. Complements kb/oop_cpp.md (a SOLID/ownership cheat sheet) with pages in the same format as stl/ and algorithms/. All 17 cards are filled in.

Базовые концепции ООПBaseline OOP concepts

Определение классов, инициализацияClass definition & initializationclass vsvs struct, member init list, порядок инициализации по порядку объявления полей., the member init list, initialization order follows declaration order, not the list.interview КонструкторыConstructorsexplicit на одноаргументных конструкторах, делегирующие конструкторы, конструктор по умолчанию. on single-argument constructors, delegating constructors, the default constructor.interview ДеструкторыDestructorsвиртуальный деструктор обязателен при удалении через указатель на базу, иначе UB.a virtual destructor is mandatory when deleting through a base-class pointer, otherwise UB.interview ПоляFieldspublic/protected/private, инициализация по умолчанию в объявлении, mutable для const-методов.public/protected/private, in-class default member initializers, mutable for const methods. МетодыMethodsconst методы, ref-qualifiers (&/&&), static методы. methods, ref-qualifiers (&/&&), static methods.interview Сигнатуры и перегрузкаSignatures & overloadingразрешение перегрузок, неявные преобразования, overload set.overload resolution, implicit conversions, the overload set. ИндексаторыIndexersoperator[] — перегрузка оператора индексации, есть const и неconst версии. — overloading the subscript operator, const and non-const overloads. НаследованиеInheritancepublic/protected/private наследование, виртуальное наследование против ромбовидной проблемы.public/protected/private inheritance, virtual inheritance against the diamond problem.interview ПолиморфизмPolymorphismдинамический (виртуальные функции, vtable, цена косвенного вызова) vs статический (шаблоны, перегрузка — полиморфизм на этапе компиляции без накладных расходов).dynamic (virtual functions, vtable, the cost of indirect calls) vs static (templates, overloading — compile-time polymorphism with no runtime overhead).interview Вложенные классыNested classesвидимость имени только внутри объемлющего класса, доступ к static-членам внешнего класса.name visibility scoped to the enclosing class, access to the outer class's static members. КонстантыConstantsstatic constexpr члены класса, inline-переменные с C++17 для определения в заголовке. class members, inline variables since C++17 for header-only definitions. Копирование объектовCopying objectscopy-конструктор и copy-присваивание, слайсинг при копировании потомка в базу по значению.the copy constructor and copy assignment, slicing when copying a derived object into a base by value.interview Члены типаType membersusing-алиасы, вложенные typedef, enum class как член класса. aliases, nested typedefs, enum class as a class member.

Специфика C++C++-specific

то, чего нет в языках со сборкой мусораwhat garbage-collected languages don't have

статус и связь с существующей шпаргалкойstatus and relation to the existing cheat sheet

2 подраздела и все 17 карточек написаны полностью. Базовые концепции ООП: определение классов, конструкторы, деструкторы, поля, методы, сигнатуры и перегрузка (базовый механизм класса и его членов), индексаторы (operator[] с const/неconst версиями и C++23 многомерным синтаксисом), вложенные классы (видимость имени, доступ к static-членам), константы (static constexpr, устранение ритуала отдельного определения через inline-переменные C++17), наследование, полиморфизм, копирование объектов (слайсинг) и члены типа (using-алиасы, enum class). К 14 базовым концепциям ООП добавлен полиморфизм, а свойства и события убраны — в C++ это не отдельная языковая конструкция, а условность (getter/setter методы, std::function-колбэки). Специфика C++: виртуальные таблицы (устройство vptr/vtable, ромбовидная проблема, PE-размещение), RAII (детерминированное освобождение ресурсов через деструктор), Rule of 0/3/5 (деструктор молча подавляет неявные move-операции — ключевая грабля) и move-семантика (std::move как каст, RVO/NRVO, когда move не бесплатен) — материал развёрнут из ядра, уже существовавшего в kb/oop_cpp.md, в полный формат страницы.2 subsections and all 17 cards are fully written. Baseline OOP concepts: class definition, constructors, destructors, fields, methods, signatures & overloading (the basic mechanics of a class and its members), indexers (operator[] with const/non-const overloads and C++23 multi-dimensional syntax), nested classes (name visibility, access to the outer class's static members), constants (static constexpr, removing the separate-definition ritual via C++17 inline variables), inheritance, polymorphism, copying objects (slicing), and type members (using aliases, enum class). Polymorphism was added to the 14 baseline OOP concepts, while properties and events were dropped — C++ has no distinct language construct for either (just a getter/setter convention, std::function callbacks). C++-specific: virtual tables (vptr/vtable mechanics, the diamond problem, PE placement), RAII (deterministic resource release via the destructor), the Rule of 0/3/5 (a destructor silently suppresses the implicit move operations — the key trap), and move semantics (std::move as a cast, RVO/NRVO, when a move isn't free) — material expanded from the core already present in kb/oop_cpp.md into the full page format.