I'm making a music resource manager class and I'm storing sf::Music in a unordered_map
std::unordered_map<std::string, std::pair<int, sf::Music>> resourceMap;
And it seems that I must use a reference or a smart pointer to store the music because of non-copyable
But instead of using this, I tried to get around with using move constructor...
resourceMap[name]=std::make_pair(1, std::move(sf::Music())); //Create the resource using "move"
resourceMap[name].second.openFromFile(name); //load the resource
std::cout<<"Loading "<<name<<" for the first time\n";
But it doesn't work
Errors I get...
1>c:\users\park\desktop\my sdks\include\sfml\system\mutex.hpp(89): error C2248: 'sf::NonCopyable::operator =' : cannot access private member declared in class 'sf::NonCopyable'
1> c:\users\park\desktop\my sdks\include\sfml\system\noncopyable.hpp(79) : see declaration of 'sf::NonCopyable::operator ='
1> c:\users\park\desktop\my sdks\include\sfml\system\noncopyable.hpp(42) : see declaration of 'sf::NonCopyable'
1> This diagnostic occurred in the compiler generated function 'sf::Mutex &sf::Mutex::operator =(const sf::Mutex &)'