I looked around, and I canβt say whether other similar questions answer or not.
// lib.h namespace lib_namespace { struct lib_struct { typedef std::vector<LibObject> struct_value; }; typedef lib_struct::struct_value lib_value; // compiler points here }; // my.h // attempt at forward declaration namespace lib_namespace { class lib_value; }; ... // my.cpp #include "lib.h"
I get an override compiler error that is understandable, but is there a way to forward a typedef declaration?
I intend to avoid adding lib.h as a dependency outside the library that I am creating. Perhaps there is a better way to achieve this?
Edit: To clarify, I try not to add an extra include include line to all project files that will use the library that I am creating, due to the third-party library that I am using, and the above situation I'm stuck. So if I include lib.h in my.cpp but not my.h
source share