3 ms·
The way to do this in C++ is via RAII. Thus instead of (with-open-file (mystream …) …) You do { mystream { class_whose_destructor_closes_the_file
by gumby 5y ago
The way to do this in C++ is via RAII.
Thus instead of
(with-open-file (mystream …) …)
You do
{
mystream { class_whose_destructor_closes_the_file (…) };
…
}
Which is uglier but in the end largely equivalent, as C++ implements unwind-protect in every execution scope.