It's the commented-out code that will not compile. When the instance of MapType goes out of scope, the type of the contained pointers cannot be unknown, because they have to be deleted.
My specific issue isn't about scope, it's strictly usage of a reference. I know for a fact that the container is not being destroyed at this specific area of code. Below is what I'm actually doing:
And since the error message is so long I've placed that in a text file and attached that to this email. If there's anything else I can provide I'd be happy to. I have no leads on what this error could mean. I wish it wasn't so cryptic.