Mark functions in ConstString as inline.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2020-02-26 13:01:21 +01:00
parent 01f1d65739
commit d08d62f3e7
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 5 additions and 6 deletions

View File

@ -1 +0,0 @@
#include "ConstString.hpp"

View File

@ -20,14 +20,14 @@ namespace Arbutils {
public: public:
constexpr explicit ConstString(const char* str) : _str(str), _length(Length(str)), _hash(Hash(str)){}; 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]] inline constexpr const char* c_str() const noexcept { return _str; }
[[nodiscard]] std::string std_str() const { return std::string(_str, _length); } [[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 #endif // ARBUTILS_CONSTSTRING_HPP