I am writing a class
In the class, I use boost::graph::adjacent_list as a private member.
but I don’t want my header file include boost header file, because any other file include my header file will need to include boost header file.
Is there a way can avoid include boost header file in my own header file.
I have tried forward declaration, but fails.
You can’t do this directly, but you can probably solve the underlying problem of not propagating an implementation detail (boost) by
pimpling your class. This essentially means that you forward declare a pointer to your implementation details, which are then fully implemented just in a source file.