G
graham
Hi ,
I have two questions.
Given a template class like this;
template <typename T1, typename T2>
class Example
{
public:
template<typename BAR>;
void foo(BAR& seq);
};
1) Is there anything wrong with this type of class declaration? I have
class instances parameterized by T1 and T2 and instances of these can
call foo with other types of parameters. My client code will be like
this (or at least I want it to be )
Example<int, long> egIntLong;
std::string str;
egIntLong.foo(str);
Ive greatly simplified obviously, but I hope this conveys what I want
to do. Don't ask me the why I want it that way, I just do
2) What should the signatture of foo bee when implemented in a .cpp
file? I can't get it right!!
thanks and have a nice day
Graham
I have two questions.
Given a template class like this;
template <typename T1, typename T2>
class Example
{
public:
template<typename BAR>;
void foo(BAR& seq);
};
1) Is there anything wrong with this type of class declaration? I have
class instances parameterized by T1 and T2 and instances of these can
call foo with other types of parameters. My client code will be like
this (or at least I want it to be )
Example<int, long> egIntLong;
std::string str;
egIntLong.foo(str);
Ive greatly simplified obviously, but I hope this conveys what I want
to do. Don't ask me the why I want it that way, I just do
2) What should the signatture of foo bee when implemented in a .cpp
file? I can't get it right!!
thanks and have a nice day
Graham