I've created a class A and a Class B, and I'm trying to set a vector of type B in A, and a vector of type A in B:
class A Header:
#ifndef A_H_
#define A_H_
#include "B.h"
#include <vector>
using namespace std;
class A {
public:
vector<B> bvector; // here is the error
A();
};
#endif /* A_H_ */
class B header:
#ifndef B_H_
#define B_H_
#include "A.h"
#include <vector>
using namespace std;
class B {
vector<A> aVector; //Here is the error
public:
B();
};
#endif /* B_H_ */
But I get the following errors:
"..\src/B.h:16:8: error: 'A' was not declared in this scope
..\src/B.h:16:9: error: template argument 1 is invalid
..\src/B.h:16:9: error: template argument 2 is invalid"
Which flips to A.h
if I delete the bad line in B. What am I doing wrong?