Make the "<<" operator call the right function in the ParseTree class.

This commit is contained in:
Username404 2021-03-27 11:13:11 +01:00
parent b21c2ae643
commit 32a9c2b0d1
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ public:
auto& getComponents() const { return subComponents; } auto& getComponents() const { return subComponents; }
void add(const ParseComponent& component) { addComp(component); }; void add(const ParseComponent& component) { addComp(component); };
void addAll(const vector<ParseComponent>& components) { addAllComps(components); } void addAll(const vector<ParseComponent>& components) { addAllComps(components); }
void operator<<(const ParseComponent& component) { addComp(component); } void operator<<(const ParseComponent& component) { add(component); }
explicit ParseTree(const ParseComponent& element): subComponents() { addComp(element); } explicit ParseTree(const ParseComponent& element): subComponents() { addComp(element); }
ParseTree(const initializer_list<ParseComponent>& elements): subComponents() { addAllComps(elements); } ParseTree(const initializer_list<ParseComponent>& elements): subComponents() { addAllComps(elements); }
ParseTree(): subComponents() {}; ParseTree(): subComponents() {};