I'm currently building a simple image manager which works with std::map internaly. It's supposed to work similarly to a repository: Images are loaded, placed in a map with their filepath for key and later accessed via this same key.
I've designed a symbolic representation of what the real class would look like using dummy classes as a test:
And I got a whooping 5 constructor calls from X.
Two standard from the XManager class, that's OK, But there are three from copy constructing. That's pretty expensive considering Images are heavy resources. Where do these calls come from? Is there anything I can do to make this more efficient? Any completely different solutions are gladly appretiated too!