Template pointer

Lets say i have a template A, and a class B. In B's constructor I pass the following argument list:

1
2
3
4
5
6
7
class B {
    B(int i, int j, &A<char>);
};

B::B(int i, int j, &A<char>) {
    A->function();
}


I get an error of:


error: base operand of '->' has non-pointer type 'A<char>'|
&A<char> is NOT a pointer type. You need this to be B(int i, int j, A<char>* parameterName) and then inside the constructor you can do parameterName->function();.
Thank you.
Topic archived. No new replies allowed.