Hi all,
I'm writing this template class and one of the template functions you pass a std::set to of a template type which then returns one of the elements in the set (which is of course a template type). I have wrote it and it compiles fine, however when i cant seem to use the function correctly without the compiler giving an error. Here is what im trying to do.
This is the template stuff
Code:
template<typename myType>
class MyTemplateClass
{
public:
const myType& PickElement (cont std::set<myType>& mySet) const
{
// returns one of the elements in the set
}
};
Now how do i use the above function? This is what i have currently got:
Code:
std::set<MyEnum> enumSet ;
MyEnum res ;
res = PickElement<MyEnum>(enumSet) ;
EDIT:
Doing a full rebuild resulted in a different error:
The compiler generates the following error:
Code:
error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'MyEnum'
Thanks for any help