I wanted to cache pictures at the beginning, using map<string, Texture>cache to store the info of the image. I wrote the code
cache[filename].loadFromFile(xxx);
but the program crashed.
I also used the ways below.
Texture temp;
temp.loadFromFile(xxx);
cache[filename]=std::move(temp);
Still did not work.
Seems like the Texture kind object cannot use '='?