From c362f422cdcc54bff3f182cd92c641f14f106cd7 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Fri, 19 Mar 2021 13:16:35 +0100 Subject: [PATCH] Don't return a reference in the getCompCount method. --- src/headers/misc.hpp | 3 +-- src/headers/parsing/ParseComponents.hpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/headers/misc.hpp b/src/headers/misc.hpp index aabc507..64b6309 100644 --- a/src/headers/misc.hpp +++ b/src/headers/misc.hpp @@ -5,8 +5,7 @@ #define YBCON_VERSION "UNKNOWN" #endif -#include -string getVersion() noexcept { return YBCON_VERSION; } +consteval const char* getVersion() noexcept { return YBCON_VERSION; } string getFileContent(const string& file); void setOutputFileContent(const string& language, const string& file, const string& content); diff --git a/src/headers/parsing/ParseComponents.hpp b/src/headers/parsing/ParseComponents.hpp index c82f369..770079d 100644 --- a/src/headers/parsing/ParseComponents.hpp +++ b/src/headers/parsing/ParseComponents.hpp @@ -18,7 +18,7 @@ private: protected: mutable vector subComponents; public: - unsigned int& getCompCount() const { return compCount; } + constexpr unsigned int getCompCount() const { return compCount; } auto& getComponents() const { return subComponents; } void add(const ParseComponent& component) { addComp(component); }; void addAll(const vector& components) { addAllComps(components); }