- Fixed some more compilation issues

- Added some more information to the licensing section of README.md
This commit is contained in:
2025-07-10 08:48:00 -04:00
parent 4c0d36c933
commit 5e0dc78210
12 changed files with 232 additions and 120 deletions

View File

@@ -136,13 +136,13 @@ public:
/// \brief Dereference Operator
/// \returns A const qualified pointer to the underlying allocation
constexpr const char* operator*() const {
return _str;
return _str.data();
}
///
/// \brief Implicit Dereference Cast
constexpr operator const char*() const {
return _str;
return _str.data();
}
@@ -163,9 +163,27 @@ public:
if (i >= size()) { // bounds check
return -1;
}
n = min(n, max(_str, str.size()) + 1);
n = fennec::min(n, fennec::max(_str, str.size()) + 1);
return ::strncmp(_str + i, str, n);
return ::strncmp(_str.data() + i, str, n);
}
///
/// \brief String Comparison
/// \param ostr the string to compare against
/// \returns Zero if both strings are equal, otherwise a negative value if lhs appears before rhs according to the
/// current locale, otherwise a positive value.
constexpr int compare(const string& str, size_t i = 0, size_t n = npos) const {
if (i >= size()) { // bounds check
return -1;
}
n = min(n, max(size(), str.size()) + 1);
return ::strncmp(_str.data() + i, str, n);
}
constexpr bool operator==(const _string& str) const {
return compare(str) == 0;
}
///