rule-of-5
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| rule-of-5 [February 18, 2026 at 03:16] – yanevskiv | rule-of-5 [May 14, 2026 at 11:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | # Rule of 5 | ||
| + | In C++, **rule of 5** | ||
| + | 1. Destructor | ||
| + | 2. Copy constructor | ||
| + | 3. Move constructor | ||
| + | 4. Copy assignment operator | ||
| + | 5. Move assignment operator | ||
| + | |||
| + | |||
| + | ```cpp | ||
| + | #pragma once | ||
| + | |||
| + | struct Image { | ||
| + | public: | ||
| + | Image(); | ||
| + | /* Todo */ | ||
| + | }; | ||
| + | ``` | ||
| + | |||
| + | ## Links | ||
| + | |||
| + | - https:// | ||
