In the template class B's function Fb, type A::InnerA is error, how to define it.
error: ‘A::InnerA’ is not a type void Fb(A::InnerA* i) {
template <typename T>
class A {
public:
class InnerA {
public:
T* get() {
return _data;
}
void set(T* t) {
_data = t;
}
private:
T* _data;
};
void Fa(InnerA* i) {
}
};
template <typename T>
class B {
public:
void Fb(A<T>::InnerA* i) {
_a.Fa(i);
}
private:
A<T> _a;
};
c++14 can compile by auto type, and what it's real type, how to define it?
template <typename T>
class B {
public:
void Fb(auto i) {
_a.Fa(i);
}
private:
A<T> _a;
};