Sign in to follow this  

Arhg, Stupid syntax error, am I misusing make_pair or insert?

This topic is 4337 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The code
template < typename resource_t >
void Manager<resource_t>::Add_To_List(const std::string & Filename, resource_t *)
{
	Resources.insert( std::make_pair( Filename , resource_t *) );
}
And the error
--------------------Configuration: Resource_Manager - Win32 Debug--------------------
Compiling...
Resource_Manager.cpp
C:\Documents and Settings\colemanjon\Desktop\Resource_Manager 1\Resource_Manager.cpp(70) : error C2059: syntax error : ')'
        c:\program files\microsoft visual studio\vc98\include\xmemory(59) : while compiling class-template member function 'void __thiscall Manager<class MS3DModel>::Add_To_List(const class std::basic_string<char,struct std::char_traits<char>,class 
std::allocator<char> > &,class MS3DModel *)'
Error executing cl.exe.
Creating browse info file...

Resource_Manager.exe - 1 error(s), 0 warning(s)

This is like, the last function that is causing my resource_system to be incomplete, please help!

Share this post


Link to post
Share on other sites
You need a parameter name for your resource_t*:


template < typename resource_t >
void Manager<resource_t>::Add_To_List(const std::string& Filename, resource_t* resource)
{
Resources.insert( std::make_pair(Filename, resource) );
}

Share this post


Link to post
Share on other sites
Hehe, I fixed it, silly me...



template < typename resource_t >
void Manager<resource_t>::Add_To_List(const std::string & Filename, resource_t * Resource)
{
Resources.insert(std::make_pair( Filename , Resource) );
}


Silly mistake

Share this post


Link to post
Share on other sites

This topic is 4337 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this