Consider a hierarchical structure like thisdirectory    [         [item_0;item_1;...;item_n]         [item_0;item_1;inner_directory[...];item_m]         other_directory             [...]    ]A directory containsAn array of strings (delimited by ';' in input data)A map from name to sub-directories (the name of the directory is followed by '[')An array of unnamed sub-directoriesThe directory can be described by this class:class Directory    {    public:        //Appropriate operations    private:        std::vector<std::string> items;        std::map<std::string, Directory> named_dirs;        std::vector<Directory> unnamed_dirs;    };However:The Directory class requires three sets of operations, resulting in a large class definitionA copy operation will be recursiveCan the data be stored in a better way avoiding at least the first point?
Compound container for storing output from a parser
data structures;parsing