Merge commit 'a1a34f27f9d873bff520a1e890f5071faa20f170'
This commit is contained in:
@ -264,8 +264,8 @@ class Signal<Error(Args...)> {
|
||||
}
|
||||
|
||||
void cleanup(Signal *signal) noexcept final {
|
||||
auto err = m_receiver->destruction.disconnectSignal(signal);
|
||||
oxErrorf("{}", toStr(err));
|
||||
std::ignore = m_receiver->destruction.disconnectSignal(signal);
|
||||
//oxErrorf("{}", toStr(err));
|
||||
//oxAssert(err, "Signal could not notify receiver that it is being destroyed. Destruction of receiver will cause use-after-free.");
|
||||
}
|
||||
|
||||
|
@ -128,6 +128,7 @@ install(
|
||||
stringview.hpp
|
||||
strongint.hpp
|
||||
strconv.hpp
|
||||
stringparam.hpp
|
||||
strops.hpp
|
||||
trace.hpp
|
||||
typeinfo.hpp
|
||||
|
@ -234,12 +234,16 @@ constexpr auto itoa(Integer v) noexcept {
|
||||
switch (sizeof(Integer)) {
|
||||
case 1:
|
||||
out = 3;
|
||||
break;
|
||||
case 2:
|
||||
out = 5;
|
||||
break;
|
||||
case 4:
|
||||
out = 10;
|
||||
break;
|
||||
case 8:
|
||||
out = 21;
|
||||
break;
|
||||
}
|
||||
return out + ox::is_signed_v<Integer>;
|
||||
}();
|
||||
|
1
deps/nostalgia/deps/ox/src/ox/std/std.hpp
vendored
1
deps/nostalgia/deps/ox/src/ox/std/std.hpp
vendored
@ -46,6 +46,7 @@
|
||||
#include "stddef.hpp"
|
||||
#include "string.hpp"
|
||||
#include "stringliteral.hpp"
|
||||
#include "stringparam.hpp"
|
||||
#include "stringview.hpp"
|
||||
#include "strongint.hpp"
|
||||
#include "strops.hpp"
|
||||
|
32
deps/nostalgia/deps/ox/src/ox/std/stringparam.hpp
vendored
Normal file
32
deps/nostalgia/deps/ox/src/ox/std/stringparam.hpp
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2015 - 2024 gary@drinkingtea.net
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "string.hpp"
|
||||
|
||||
namespace ox {
|
||||
|
||||
class StringParam {
|
||||
private:
|
||||
ox::String m_value;
|
||||
public:
|
||||
StringParam(StringParam const&) = delete;
|
||||
constexpr StringParam(StringParam &&o) noexcept: m_value{std::move(o.m_value)} {}
|
||||
constexpr StringParam(char const*value) noexcept: m_value{value} {}
|
||||
constexpr StringParam(detail::BaseStringView const&value) noexcept: m_value{value} {}
|
||||
constexpr StringParam(ox::String const&value) noexcept: m_value{value} {}
|
||||
constexpr StringParam(ox::String &&value) noexcept: m_value{std::move(value)} {}
|
||||
constexpr operator ox::String() && noexcept { return std::move(m_value); }
|
||||
explicit constexpr operator ox::CStringView() const noexcept { return m_value; }
|
||||
explicit constexpr operator ox::StringView() const noexcept { return m_value; }
|
||||
[[nodiscard]]
|
||||
constexpr ox::CStringView view() const noexcept { return m_value; }
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user