Is there a way to declare a pointer to an incomplete type to be set using typedef in the implementation?
Here is an example of what I want:
#ifndef TEST_H #define TEST_H namespace std { class string;
string is a typedef for basic_string, so the code in the example will not work. I can declare an incomplete type std :: basic_string, but it looks like a workaround.
I know that the compiler will not generate characters for typedefs, and it may happen that the same name can be used in typedef for different types in different files. But since a pointer is a pointer (at least for the compiler), it should be able to do something like this.
EDIT . This is just a minimalist working example. In my real problem, I have a Facade that uses a class from a library that only Facade should know (no, it's not std :: string, and the library is not stl). I donโt care about circular inclusion, but since there are a lot of files in my project that include or indirectly this facade, I am worried about compilation time, so I want to include the library file only in the Facade implementation file.
source share