Creating std::map of templates

Started by
10 comments, last by garyfletcher 18 years, 9 months ago
The compiler was complaining about the argTypes tydef. it was lookign for a matching function but couldn't find one. The error messages had expanded the variant type def

Ah...I've made mods to the code to try to use a template function to pass in arguments of any type and then add it to the map. Is still complaining though:

template <class aType, class bType>bool myClass::mRegArgument(int aFuncID, aType& argName, bType& argValue){   // stuff}called with:if(!GE->mRegArgument(funcID,arg1,50)){    std::cout << "Unable to register arg1" << std::endl;   }


Error:

SiSE2DDev.cpp:234: error: no matching function for call to `SiSE::mRegArgument(int&, std::string&, int)'
C:/SiSE/include/SiSE.h:126: note: candidates are: bool SiSE::mRegArgument(int, aType&, bType&) [with aType = std::string, bType = int]

Any ideas?

[Edited by - garyfletcher on June 30, 2005 1:00:06 AM]
Gary.Goodbye, and thanks for all the fish.
Advertisement
I know why now. I was passing 50, an absolute value, in but the template function was expecting something it could reference...doh. It's late.

[Edited by - garyfletcher on June 30, 2005 1:11:56 AM]
Gary.Goodbye, and thanks for all the fish.

This topic is closed to new replies.

Advertisement