diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-08-30 18:35:23 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-08-30 18:35:23 +0200 |
| commit | 5e3b4b6c21d33b28e60ce976479339f72d544a6c (patch) | |
| tree | 0e5a101d4944e7dd5a99606344b6a6807a9a5606 /src/blog/2024-12-26-taming-cpp-raii/taming-cpp-raii.md | |
| parent | d3f0841cfdd229ff16b8a230117737a435fc7a56 (diff) | |
| download | sebastiano.tronto.net-5e3b4b6c21d33b28e60ce976479339f72d544a6c.tar.gz sebastiano.tronto.net-5e3b4b6c21d33b28e60ce976479339f72d544a6c.zip | |
Switch from stagit to cgit
Diffstat (limited to 'src/blog/2024-12-26-taming-cpp-raii/taming-cpp-raii.md')
| -rw-r--r-- | src/blog/2024-12-26-taming-cpp-raii/taming-cpp-raii.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/blog/2024-12-26-taming-cpp-raii/taming-cpp-raii.md b/src/blog/2024-12-26-taming-cpp-raii/taming-cpp-raii.md index 6450521..a7c1bae 100644 --- a/src/blog/2024-12-26-taming-cpp-raii/taming-cpp-raii.md +++ b/src/blog/2024-12-26-taming-cpp-raii/taming-cpp-raii.md | |||
| @@ -61,7 +61,7 @@ But there is a more interesting way to make this program fail by only | |||
| 61 | changing the definition of `BadType`. In fact, you can make this program | 61 | changing the definition of `BadType`. In fact, you can make this program |
| 62 | do pretty much everything you want by changing `BadType`'s *constructor* | 62 | do pretty much everything you want by changing `BadType`'s *constructor* |
| 63 | to suit your needs (see | 63 | to suit your needs (see |
| 64 | [surprising-error.cpp](https://git.tronto.net/taming-cpp/file/raii/surprising-error.cpp.html)): | 64 | [surprising-error.cpp](https://git.tronto.net/taming-cpp/tree/raii/surprising-error.cpp)): |
| 65 | 65 | ||
| 66 | ``` | 66 | ``` |
| 67 | class BadType { | 67 | class BadType { |
| @@ -83,7 +83,7 @@ And it does not stop here either: whenever a variable | |||
| 83 | of a class type goes out of scope, the corresponding | 83 | of a class type goes out of scope, the corresponding |
| 84 | [destructor](https://en.cppreference.com/w/cpp/language/destructor) | 84 | [destructor](https://en.cppreference.com/w/cpp/language/destructor) |
| 85 | is called - see | 85 | is called - see |
| 86 | [constructor-hello-world.cpp](https://git.tronto.net/taming-cpp/file/raii/constructor-hello-world.cpp.html): | 86 | [constructor-hello-world.cpp](https://git.tronto.net/taming-cpp/tree/raii/constructor-hello-world.cpp): |
| 87 | 87 | ||
| 88 | ``` | 88 | ``` |
| 89 | #include <iostream> | 89 | #include <iostream> |
| @@ -254,7 +254,7 @@ from a function is a classic example, but they also come up when using | |||
| 254 | [smart pointers](https://en.cppreference.com/book/intro/smart_pointers). | 254 | [smart pointers](https://en.cppreference.com/book/intro/smart_pointers). |
| 255 | 255 | ||
| 256 | I made a | 256 | I made a |
| 257 | [comprehensive example](https://git.tronto.net/taming-cpp/file/raii/all-constructors.cpp.html) | 257 | [comprehensive example](https://git.tronto.net/taming-cpp/tree/raii/all-constructors.cpp) |
| 258 | of how all of these operations work, so you can see when exactly each | 258 | of how all of these operations work, so you can see when exactly each |
| 259 | of them is called. Do check it out if you are interested! | 259 | of them is called. Do check it out if you are interested! |
| 260 | 260 | ||
