Make the "<<" operator call the right function in the ParseTree class.
This commit is contained in:
parent
b21c2ae643
commit
32a9c2b0d1
|
@ -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() {};
|
||||||
|
|
Loading…
Reference in New Issue