Hello Andrew,
after reading through your proposal I found some things that don't seem quite right.
While I can understand the need of a garbage collector in some use cases, the one featured in the proposal is one of the less convincing examples.
The code is generating a lot of objects that are not needed anywhere just to throw them away some time later.
For me, this is an anti-pattern.
Using a Dungeon class as owner for the rooms of the Dungeon, rather than
just defining ownership by the room self-referencing each other, you can implement your example with an recursive approach:
There is still a lot to optimize, but I don't see the need for gc.
Regards,
Simon
P.S.
1. Your main-function uses 'uniform_real_distribution' instead of 'uniform_int_distribution'. This won't compile for size_t.
2. You are initializing the Mersenne-Twister generators with 'std::mt19937 gen(std::random_device{});' which should be 'std::mt19937 gen(std::random_device{}());' (parenthesis)