[ox/std] Fix StringLiteral::operator= to work with DevkitARM
This commit is contained in:
14
deps/ox/src/ox/std/stringliteral.hpp
vendored
14
deps/ox/src/ox/std/stringliteral.hpp
vendored
@ -20,26 +20,24 @@ namespace ox {
|
||||
* that is not a literal.
|
||||
* If you do this:
|
||||
* StringLiteral(str.c_str())
|
||||
* the resulting segfault is on you.
|
||||
* the resulting segfault is on you.
|
||||
*/
|
||||
class StringLiteral: public detail::BaseStringView {
|
||||
public:
|
||||
constexpr StringLiteral() noexcept = default;
|
||||
|
||||
constexpr StringLiteral(StringLiteral const&sv) noexcept = default;
|
||||
constexpr StringLiteral(StringLiteral const &sv) noexcept = default;
|
||||
|
||||
constexpr explicit StringLiteral(std::nullptr_t) noexcept {}
|
||||
|
||||
constexpr explicit StringLiteral(const char *str, std::size_t len) noexcept: BaseStringView(str, len) {}
|
||||
constexpr explicit StringLiteral(const char *str, std::size_t len) noexcept: BaseStringView{str, len} {}
|
||||
|
||||
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
||||
constexpr explicit StringLiteral(char const *str) noexcept: StringLiteral(str, ox::strlen(str)) {}
|
||||
constexpr explicit StringLiteral(char const *str) noexcept: StringLiteral{str, ox::strlen(str)} {}
|
||||
OX_ALLOW_UNSAFE_BUFFERS_END
|
||||
|
||||
constexpr StringLiteral &operator=(StringLiteral const&other) noexcept {
|
||||
if (&other != this) {
|
||||
set(other.data(), other.len());
|
||||
}
|
||||
constexpr StringLiteral &operator=(StringLiteral const &other) noexcept {
|
||||
set(other.data(), other.len());
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user