← Back to archive

Stdle #2 · 2026-06-08

What does this log?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

#include <iostream>
struct Box {
int v;
Box(int n) : v(n) {}
};
Box pick(bool b) {
return b ? Box(1) : Box(2);
}
int main() {
std::cout << pick(false).v << "\n";
return 0;
}
Conversions
4 attempts left

Answer & explanation