class - Can you solve this circular dependency problem in C++? -
there object class clone() function can throw clonenotsupportedexception* , declared such. clonenotsupportedexception derives exception, derives object.
inheritance requires complete types, , have 2 of them, it's obvious can't break circular dependency there. member pointers , pointer parameters content incomplete types, seemingly not enough throw declarations, if throw pointers.
class definitions separate implementations, forward declarations used, pointers everywhere. still not enough.
is there way break dependency, or impossible in c++?
skip exception specification, it's worthless.
class object { virtual object* clone() = 0; virtual ~object() {} }; done.
by way, design sounds utterly wrong, can't bring myself not comment on it.
Comments
Post a Comment