aboutsummaryrefslogtreecommitdiff
path: root/src/blog/2024-12-26-taming-cpp-raii/taming-cpp-raii.md
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-08-30 18:35:23 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2026-08-30 18:35:23 +0200
commit5e3b4b6c21d33b28e60ce976479339f72d544a6c (patch)
tree0e5a101d4944e7dd5a99606344b6a6807a9a5606 /src/blog/2024-12-26-taming-cpp-raii/taming-cpp-raii.md
parentd3f0841cfdd229ff16b8a230117737a435fc7a56 (diff)
downloadsebastiano.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.md6
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
61changing the definition of `BadType`. In fact, you can make this program 61changing the definition of `BadType`. In fact, you can make this program
62do pretty much everything you want by changing `BadType`'s *constructor* 62do pretty much everything you want by changing `BadType`'s *constructor*
63to suit your needs (see 63to 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```
67class BadType { 67class BadType {
@@ -83,7 +83,7 @@ And it does not stop here either: whenever a variable
83of a class type goes out of scope, the corresponding 83of 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)
85is called - see 85is 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
256I made a 256I 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)
258of how all of these operations work, so you can see when exactly each 258of how all of these operations work, so you can see when exactly each
259of them is called. Do check it out if you are interested! 259of them is called. Do check it out if you are interested!
260 260

Generated with cgit - Back to sebastiano.tronto.net