Resource &
ResourceHolder<Resource,Identifier>::get(Identifier id)
{
auto resIter = mMap.find(id);
if (resIter == mMap.end()) {
throw std::runtime_error("ResourceHolder::get - ID not found.");
}
return *resIter; // error message refers to this line
}
I get this error message
error: invalid initialization of reference of type ‘Texture&’ ...
Thank you for your help!
*resIter didn't return Resource&, but rather it returned a std::pair. so all I needed was changing return *resIter; to return *resIter->second;.