I am trying to use a type alias for an object in a different header without including a header file.
My simplified version of the code:
#include <vector>
using Vector=std::vector<int>;
====================================================
using Vector;
int foo(Vector*);
====================================================
#include "A.h"
void foo(Vector*){}
I don't want to write using Vector=std::vector<int>;again in B.h, because this definition should be the same as definition Vectorin A.h, and it may change in the future , and I can't include it because my code has a circular dependency .
Is a declaration of usingpossible in C ++ 11?
source
share