Removed std::string_view ctor on StringView.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
083c00f85e
commit
9f5b8e9c83
|
@ -1,3 +1,3 @@
|
|||
#include "StringView.hpp"
|
||||
|
||||
ArbUt::__ConstStringCharHolder* ArbUt::StringView::__emptyString = new __ConstStringCharHolder(std::string_view("", 0));
|
||||
ArbUt::__ConstStringCharHolder* ArbUt::StringView::__emptyString = new __ConstStringCharHolder("", 0);
|
||||
|
|
|
@ -23,19 +23,12 @@ namespace ArbUt {
|
|||
__ConstStringCharHolder& operator=(const __ConstStringCharHolder& other) = delete;
|
||||
|
||||
public:
|
||||
__ConstStringCharHolder(const std::string_view& value) noexcept
|
||||
: _value(new char[value.length() + 1]), _references(1) {
|
||||
strncpy(_value, value.data(), value.length() + 1);
|
||||
}
|
||||
__ConstStringCharHolder(const char* value, size_t length) noexcept
|
||||
: _value(new char[length + 1]), _references(1) {
|
||||
strncpy(_value, value, length + 1);
|
||||
}
|
||||
|
||||
~__ConstStringCharHolder() noexcept {
|
||||
delete[] _value;
|
||||
_value = nullptr;
|
||||
}
|
||||
~__ConstStringCharHolder() noexcept { delete[] _value; }
|
||||
|
||||
inline void RemoveReference() noexcept {
|
||||
if (--_references <= 0) {
|
||||
|
@ -68,8 +61,6 @@ namespace ArbUt {
|
|||
}
|
||||
|
||||
public:
|
||||
StringView(const std::string_view& str) noexcept
|
||||
: BasicStringView(str.length(), Hash(str.data())), _str(new __ConstStringCharHolder(str)) {}
|
||||
StringView(const char* str) noexcept
|
||||
: BasicStringView(CalcLength(str), Hash(str)), _str(new __ConstStringCharHolder(str, CalcLength(str))) {}
|
||||
StringView(const char* str, size_t length) noexcept
|
||||
|
|
Loading…
Reference in New Issue