I know it's possible to make a template function:
template<typename T>
void DoSomeThing(T x){}
and it's possible to make a template class:
template<typename T>
class Object
{
public:
int x;
};
but is it possible to make a class not within a template, and then make a function in that class a template? Ie:
//I have no idea if this is right, this is just how I think it would look
class Object
{
public:
template<class T>
void DoX(){}
};
or something to the extent, where the class is not part of a template, but the function is?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…