I'll just post the code, Apparently I'm performing some kind of illegal overload
Resource_Manager.h
Code:
template < typename resource_t >
class Manager
{
std::map< std::string , resource_t* > Resources;
public:
resource_t & Load( const std::string & filename );
virtual ~Manager( void )
{
std::map< std::string , resource_t * >::iterator destroyer, end;
for ( destroyer = Resources.begin() , end = Resources.end() ; destroyer != end ; ++destroyer )
{
delete destroyer->second;
}
}
};
Resource_Manager.cpp
Code:
template < typename resource_t >
resource_t & Manager<resource_t>::Load( std::string & filename )
{
std::map< std::string , resource_t* >::iterator entry = Resources.find( filename );
if ( entry != resources.end() ) // if the entry is found
{
return * entry->second; // return the reference to the resource
}
else
{
resource_t* resource( new resource_t( filename ) );
// first we gotta load the resource, then we can make a pair
// and return the reference
resources.insert( std::make_pair( filename , resource ) );
return * resource;
}
}
And of course this bugger of an error
Code:
C:\Documents and Settings\Jonathan\My Documents\C++ Programming\Resource_Manager\Resource_Manager.cpp(48) : error C2244: 'Manager<resource_t>::Load' : unable to resolve function overload
I'm sure it is a silly syntax error I can't spot, any takers?