From d08d62f3e76ca959afd5bc1aebd03f08f9856957 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 26 Feb 2020 13:01:21 +0100 Subject: [PATCH] Mark functions in ConstString as inline. --- src/ConstString.cpp | 1 - src/ConstString.hpp | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 src/ConstString.cpp diff --git a/src/ConstString.cpp b/src/ConstString.cpp deleted file mode 100644 index 1880fe0..0000000 --- a/src/ConstString.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "ConstString.hpp" diff --git a/src/ConstString.hpp b/src/ConstString.hpp index b2ea282..68c415b 100644 --- a/src/ConstString.hpp +++ b/src/ConstString.hpp @@ -20,14 +20,14 @@ namespace Arbutils { public: constexpr explicit ConstString(const char* str) : _str(str), _length(Length(str)), _hash(Hash(str)){}; - [[nodiscard]] constexpr const char* c_str() const noexcept { return _str; } - [[nodiscard]] std::string std_str() const { return std::string(_str, _length); } + [[nodiscard]] inline constexpr const char* c_str() const noexcept { return _str; } + [[nodiscard]] inline std::string std_str() const { return std::string(_str, _length); } - [[nodiscard]] constexpr size_t Length() const noexcept { return _length; } + [[nodiscard]] inline constexpr size_t Length() const noexcept { return _length; } - [[nodiscard]] constexpr uint32_t GetHash() const noexcept { return _hash; } + [[nodiscard]] inline constexpr uint32_t GetHash() const noexcept { return _hash; } }; - constexpr ConstString operator"" _const(const char* c) { return ConstString(c); } + inline constexpr ConstString operator"" _const(const char* c) { return ConstString(c); } } #endif // ARBUTILS_CONSTSTRING_HPP