Add a return type to the ParseTree "<<" operator.
This commit is contained in:
parent
2a5df0bb32
commit
c23d88e0eb
|
@ -22,7 +22,8 @@ public:
|
||||||
subComponents.push_back(component);
|
subComponents.push_back(component);
|
||||||
}; void addAll(const vector<ParseComponent>& components) const {
|
}; void addAll(const vector<ParseComponent>& components) const {
|
||||||
for (const auto& comp: components) add(comp);
|
for (const auto& comp: components) add(comp);
|
||||||
}; void operator<<(const ParseComponent& component) const { add(component); }
|
}
|
||||||
|
const ParseTree& operator<<(const ParseComponent& component) const { add(component); return *this; }
|
||||||
explicit ParseTree(const ParseComponent& element): subComponents() { add(element); }
|
explicit ParseTree(const ParseComponent& element): subComponents() { add(element); }
|
||||||
ParseTree(const initializer_list<ParseComponent>& elements): subComponents() { addAll(elements); }
|
ParseTree(const initializer_list<ParseComponent>& elements): subComponents() { addAll(elements); }
|
||||||
ParseTree(): subComponents() {};
|
ParseTree(): subComponents() {};
|
||||||
|
|
Loading…
Reference in New Issue