Class template and static member function

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top