I am porting some C# code to C++ and have the following problem, see the simplified code below. My filesystem class depends on the directory class which in return inherits from the filesystem class. This seems to work in C# but not in C++. Is there a simple trick to break this?
class fileSystemItem{
private:
Directory* parent;
};
class Directory : public fileSystemItem{
};
A forward declaration of
directory:Note the consistent capitalization.