andreyvul wrote:
[...]
The actual code was:
template <class Tstruct Square {}
template <class Tstruct Triangle {}
std::vector<std::pair<Square<T>, Triangle<T *
recarrow(T a, T b, int n) {}
Why must the template class be forward-declared still?
It doesn't have to be forward-declared.
After I fixed your code it looks like this:
#include <vector>
#include <utility>
template <class Tstruct Square {};
template <class Tstruct Triangle {};
template <class T>
std::vector<std::pair<Square<T>, Triangle<T *
recarrow(T a, T b, int n) {return NULL;}
This compiles just fine.
If you still have problems in your real code, you might
consider doing as the FAQ asks you to: Get your problem
down to a small program with as few lines as possible
which still exhibits your problem and post this here.
Then we have something to look at, instead of blindly
guessing what your real code might look like.
Schobi