Remove useless inlined functions in ParseComponents.hpp

This commit is contained in:
Username404-59 2021-06-10 13:22:17 +02:00
parent 86985501e5
commit a75cbeb129
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 8 additions and 8 deletions

View File

@ -12,19 +12,19 @@ class ParseComponent {};
struct ParseTree: public ParseComponent {
private:
mutable unsigned int compCount = 0;
inline void addComp(const auto& comp) const {
subComponents.push_back(comp); ++compCount;
}; inline void addAllComps(const auto& comps) const { for (const auto& comp: comps) addComp(comp); }
protected:
mutable vector<ParseComponent> subComponents;
public:
constexpr unsigned int getCompCount() const { return compCount; }
auto& getComponents() const { return subComponents; }
void add(const ParseComponent& component) { addComp(component); };
void addAll(const vector<ParseComponent>& components) { addAllComps(components); }
void operator<<(const ParseComponent& component) { add(component); }
explicit ParseTree(const ParseComponent& element): subComponents() { addComp(element); }
ParseTree(const initializer_list<ParseComponent>& elements): subComponents() { addAllComps(elements); }
void add(const ParseComponent& component) const {
subComponents.push_back(component);
++compCount;
}; void addAll(const vector<ParseComponent>& components) const {
for (const auto& comp: components) add(comp);
}; void operator<<(const ParseComponent& component) const { add(component); }
explicit ParseTree(const ParseComponent& element): subComponents() { add(element); }
ParseTree(const initializer_list<ParseComponent>& elements): subComponents() { addAll(elements); }
ParseTree(): subComponents() {};
~ParseTree() = default;
};