Sorry I ill formed the question earlier. The piece of code is something like:
class Bar
{
public:
// some stuff
private:
struct Foo
{
std::unordered_map<std::string, std::unique_ptr<Foo>> subFoo;
// some other basic variables here
};
Foo foo;
};
I got the basic idea about subFoo. But I am wondering that a single instance of Bar will contain only a single instance of Foo that is foo member variable? So a single instance/object of Bar will not be able to map multiple Foo inside the subFoo?
It feels like I am missing something here, can anyone break it down for me?