Stdle #91 · raii · 2026-09-05
What does this C++ snippet output?
A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
#include <iostream> struct Noisy { int id; Noisy(int i) : id(i) { std::cout << "ctor " << id << "\n"; } ~Noisy() { std::cout << "dtor " << id << "\n"; }};int main() { { Noisy a(1); } std::cout << "after block\n";}RAII