Holy shit it compiled. Made the StackOfAnything into a template class as well, as I think it was supposed to be from the beginning. Kind of silly of me.
[boxOfAnything] Almost complete. Needs commenting and exception handling tidied up.
Working. Needs comments still.