I want my class to have an attribute which would be an instance of the same class, something like this:
class Person
{
public:
std::string name;
Person nested;
};
Here my IDE (Visual Studio 2022) says incomplete type is not allowed. Is it possible to have an instance of the same class inside a class in C++? How can I implement this?