I have the following code:
template <typename A, typename B>
struct TheStruct {
A a;
B b;
};
class TheClass {
public:
void do_something(TheStruct<A,B> blah);
}
I get compiler errors on the do_somethng method that resembles error: 'A' was not declared in this scope…
What is the correct syntax for defining this kind of type in a method parameter?
Thanks!
You’ll need to either make
TheClassa template:Or you’ll need to make
do_something()a template: