Before std::variant existed, heterogeneous slots were built exactly like this: a tag plus storage, with a proxy that assigns, reports the tag and converts back. The exam strips it to three known types — enough to meet every mechanism a real variant needs.
BarFooIntArray<N> stores N slots, each holding a Bar, a Foo or an int. arr[i] = Bar{} assigns; arr[i].IsBar()/IsFoo()/IsInt() report what is inside; Bar b = arr[0] and int x = arr[2] convert back. A miniature variant built by hand.
A slot is a tag enum plus an int payload (Bar and Foo carry no data). The proxy points at the slot.
Three operator= overloads set the tag; three conversion operators go back. Only int needs real storage.
Hit Submit (or ⌘/Ctrl + ↵) — test results will show up here.