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

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,216
Latest member
Best cryptoconsultant

Latest Threads

Top