From 43136672bd03467fba2b5bd53884431344c2b2d6 Mon Sep 17 00:00:00 2001 From: Username404 Date: Sun, 8 Aug 2021 22:51:49 +0200 Subject: [PATCH] Remove the ParseComponents constructor declaration and make NamedIdentifier.name a const variable again --- src/headers/parsing/ParseComponents.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/headers/parsing/ParseComponents.hpp b/src/headers/parsing/ParseComponents.hpp index fdf61d4..f755603 100644 --- a/src/headers/parsing/ParseComponents.hpp +++ b/src/headers/parsing/ParseComponents.hpp @@ -17,15 +17,14 @@ using namespace std; #define IS_PARSECOMPONENT IS(ParseComponent) struct ParseComponent { [[nodiscard]] const type_info& getId() const { return typeid(*this); } - ParseComponent() = default; virtual ~ParseComponent() = default; }; namespace StandardComponents { struct [[deprecated]] Expression: ParseComponent {}; struct NamedIdentifier: public ParseComponent { - string name; - explicit NamedIdentifier(string_view nameText): ParseComponent(), name(nameText) {} + const string name; + explicit NamedIdentifier(string_view nameText): name(nameText) {} }; struct Define: NamedIdentifier { const bool final; @@ -41,7 +40,7 @@ namespace StandardComponents { namespace types { struct String: ParseComponent { const char* content; - explicit String(const char* string): ParseComponent(), content(string) {} + explicit String(const char* string): content(string) {} }; } }