A
ajay.sonawane
How to call static member function of template class.
For example
template <typename T>
class A
{
private:
int m_i;
static m_j;
public:
int GetSum()
{
return m_i + T::i;
}
static int GetJ()
{
return m_j;
}
}
class B
{
public:
int i;
}
I can use this template class as
A<B> m_A;
m_A.GetSum();
But how could I access static member function GetJ() of template class
A ?
Is it like this
A<>.GetJ();
Let me know solution.
For example
template <typename T>
class A
{
private:
int m_i;
static m_j;
public:
int GetSum()
{
return m_i + T::i;
}
static int GetJ()
{
return m_j;
}
}
class B
{
public:
int i;
}
I can use this template class as
A<B> m_A;
m_A.GetSum();
But how could I access static member function GetJ() of template class
A ?
Is it like this
A<>.GetJ();
Let me know solution.