On Fri, Feb 6, 2009 at 9:55 AM, Robert Dailey <rcdailey@gmail.com> wrote:
On Fri, Feb 6, 2009 at 9:03 AM, John Wilkinson <jwilkinson@tsystem.com> wrote:
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:

    static Texture const* FindTexture( std::string const& textureId, TextureContainer const& textures )
    {
        TextureContainer::const_iterator it = textures.find( textureId );
        if( it == textures.end() )
        {
            /// @todo Throw an exception here?
            assert(0);
        }

        return it->second;
    }

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.

When I provide the full class definition (versus the forward declaration), it still fails because class Texture is boost::noncopyable. Why is ptr_map::find() trying to copy construct a Texture? This shouldn't be happening...