From c23d88e0ebf7f5113ea164ef8fd844c26a8fee1c Mon Sep 17 00:00:00 2001 From: Username404 Date: Sat, 7 Aug 2021 13:33:13 +0200 Subject: [PATCH] Add a return type to the ParseTree "<<" operator. --- src/headers/parsing/ParseComponents.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/headers/parsing/ParseComponents.hpp b/src/headers/parsing/ParseComponents.hpp index dad5d59..6a1c619 100644 --- a/src/headers/parsing/ParseComponents.hpp +++ b/src/headers/parsing/ParseComponents.hpp @@ -22,7 +22,8 @@ public: subComponents.push_back(component); }; void addAll(const vector& components) const { 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); } ParseTree(const initializer_list& elements): subComponents() { addAll(elements); } ParseTree(): subComponents() {};