My question concerns the templates again... From my static template function "functionA" in non template class A
A.h
#ifndef A_H
#define A_H
#include "B.h"
class A
{
template <class T>
static T functionA();
};
template <class T>
T A::functionA()
{
T var;
T result = B::functionB(var); //Class B has not been declared
}
#endif
I am calling static template function "function B" declared and defined inside non template class B. Before the class A declaration class B has already been included...
B.h
#ifndef B_H
#define B_H
class B
{
template <class T>
static T functionB(T var) ;
};
template<class T>
T B::functionB(T var)
{
...some code
}
#endif
During the compilation of the program the following error message has been apperared:
//Class B has not been declared
This is not a real code, only example for the ilustration. This situation has appeared calling some static methods i my program. Can you help me, please?