Files
lab-cpp-raii/src/task02/main.cpp
T
2026-07-21 20:11:42 +02:00

5 lines
295 B
C++

#include <iostream>
struct Guard { Guard() { std::cout << "acquire\n"; } ~Guard() { std::cout << "release\n"; } };
void work(bool short_path) { Guard guard; if (short_path) { std::cout << "work=short\n"; return; } std::cout << "work=long\n"; }
int main() { work(true); std::cout << "after\n"; }