Sign in to follow this  
Headkaze

[C++] Add map item passed in by reference

Recommended Posts

Why doesn't the following work? Searched everywhere. I want to pass the map in by reference so it doesn't copy it over. Why can't I add an item to the map?

bool Texture2D::ParseTextureAtlas(const string& fileName, const map<string, ImageDef>& imageMap)
{
imageMap["whatever"] = ImageDef(...);

return true;
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this