diff --git a/deps/ox/src/ox/claw/write.hpp b/deps/ox/src/ox/claw/write.hpp index bc4963dd..ba0890ef 100644 --- a/deps/ox/src/ox/claw/write.hpp +++ b/deps/ox/src/ox/claw/write.hpp @@ -61,14 +61,14 @@ struct type_version { template constexpr const char *getTypeName(const T *t) noexcept { TypeInfoCatcher tnc; - oxIgnoreError(model(&tnc, t)); + std::ignore = model(&tnc, t); return tnc.name; } template constexpr int getTypeVersion(const T *t) noexcept { TypeInfoCatcher tnc; - oxIgnoreError(model(&tnc, t)); + std::ignore = model(&tnc, t); return tnc.version; } diff --git a/deps/ox/src/ox/event/signal.hpp b/deps/ox/src/ox/event/signal.hpp index 51e6853c..dee28494 100644 --- a/deps/ox/src/ox/event/signal.hpp +++ b/deps/ox/src/ox/event/signal.hpp @@ -391,7 +391,7 @@ Error Signal::disconnectObject(const void *receiver) const noexc template void Signal::emit(Args... args) const noexcept { for (auto &f : m_slots) { - oxIgnoreError(f->call(ox::forward(args)...)); + std::ignore = f->call(ox::forward(args)...); } } diff --git a/deps/ox/src/ox/logconn/logconn.cpp b/deps/ox/src/ox/logconn/logconn.cpp index 9a0ec190..b5c59126 100644 --- a/deps/ox/src/ox/logconn/logconn.cpp +++ b/deps/ox/src/ox/logconn/logconn.cpp @@ -98,7 +98,7 @@ void LoggerConn::msgSend() noexcept { break; } //std::printf("LoggerConn: sending %lu bytes\n", read); - oxIgnoreError(send(tmp.data(), read)); + std::ignore = send(tmp.data(), read); } } } diff --git a/deps/ox/src/ox/model/modelops.hpp b/deps/ox/src/ox/model/modelops.hpp index 6eacc078..e8c4ad06 100644 --- a/deps/ox/src/ox/model/modelops.hpp +++ b/deps/ox/src/ox/model/modelops.hpp @@ -276,8 +276,8 @@ constexpr void moveModel(T *dst, T *src) noexcept { constexpr auto size = ModelFieldCount_v; detail::MemberList dstFields; detail::Mover mover(&dstFields); - oxIgnoreError(model(&dstFields, dst)); - oxIgnoreError(model(&mover, src)); + std::ignore = model(&dstFields, dst); + std::ignore = model(&mover, src); } template @@ -285,8 +285,8 @@ constexpr void copyModel(T *dst, const T *src) noexcept { constexpr auto size = ModelFieldCount_v; detail::MemberList dstFields; detail::Copier copier(&dstFields); - oxIgnoreError(model(&dstFields, dst)); - oxIgnoreError(model(&copier, src)); + std::ignore = model(&dstFields, dst); + std::ignore = model(&copier, src); } template @@ -295,8 +295,8 @@ constexpr bool equalsModel(T *a, T *b) noexcept { constexpr auto size = T::Fields; detail::MemberList aFields; detail::Equals equals(&aFields); - oxIgnoreError(model(&aFields, a)); - oxIgnoreError(model(&equals, b)); + std::ignore = model(&aFields, a); + std::ignore = model(&equals, b); return equals.value; } diff --git a/deps/ox/src/ox/model/modelvalue.hpp b/deps/ox/src/ox/model/modelvalue.hpp index fed9f037..90088cf3 100644 --- a/deps/ox/src/ox/model/modelvalue.hpp +++ b/deps/ox/src/ox/model/modelvalue.hpp @@ -1057,13 +1057,13 @@ constexpr ModelValue::ModelValue(ModelValue &&other) noexcept { template constexpr ModelValue::ModelValue(const T &val) noexcept requires(!ox::is_same_v, ModelValue>) { - oxIgnoreError(set(val)); + std::ignore = set(val); } template constexpr ModelValue::ModelValue(T &&val) noexcept requires(!ox::is_same_v, ModelValue>) { - oxIgnoreError(set(ox::forward(val))); + std::ignore = set(ox::forward(val)); } constexpr ModelValue::~ModelValue() noexcept { diff --git a/deps/ox/src/ox/model/typenamecatcher.hpp b/deps/ox/src/ox/model/typenamecatcher.hpp index 41451260..f64377b2 100644 --- a/deps/ox/src/ox/model/typenamecatcher.hpp +++ b/deps/ox/src/ox/model/typenamecatcher.hpp @@ -99,7 +99,7 @@ struct TypeInfoCatcher { template constexpr int getModelTypeVersion(T *val) noexcept { TypeInfoCatcher nc; - oxIgnoreError(model(&nc, val)); + std::ignore = model(&nc, val); return nc.version; } @@ -122,7 +122,7 @@ consteval int requireModelTypeVersion() noexcept { template constexpr Str getModelTypeName(T *val) noexcept { TypeNameCatcher nc; - oxIgnoreError(model(&nc, val)); + std::ignore = model(&nc, val); return nc.name; } diff --git a/deps/ox/src/ox/std/bstring.hpp b/deps/ox/src/ox/std/bstring.hpp index f5625f8f..6686701d 100644 --- a/deps/ox/src/ox/std/bstring.hpp +++ b/deps/ox/src/ox/std/bstring.hpp @@ -8,6 +8,7 @@ #pragma once +#include "ignore.hpp" #include "memops.hpp" #include "stringview.hpp" #include "strops.hpp" @@ -145,7 +146,7 @@ constexpr BString &BString::operator=(char *str) noexcept { template constexpr BString &BString::operator+=(const char *str) noexcept { std::size_t strLen = ox::strlen(str) + 1; - oxIgnoreError(append(str, strLen)); + std::ignore = append(str, strLen); return *this; } @@ -164,7 +165,7 @@ constexpr BString &BString::operator+=(Integer_c auto i) noexcept { template constexpr BString &BString::operator+=(StringView s) noexcept { std::size_t strLen = s.bytes(); - oxIgnoreError(append(s.data(), strLen)); + std::ignore = append(s.data(), strLen); return *this; } @@ -172,7 +173,7 @@ template constexpr BString BString::operator+(const char *str) const noexcept { auto out = *this; std::size_t strLen = ox::strlen(str) + 1; - oxIgnoreError(out.append(str, strLen)); + std::ignore = out.append(str, strLen); return out; } diff --git a/deps/ox/src/ox/std/error.hpp b/deps/ox/src/ox/std/error.hpp index 4ccab842..1f53426a 100644 --- a/deps/ox/src/ox/std/error.hpp +++ b/deps/ox/src/ox/std/error.hpp @@ -314,7 +314,3 @@ constexpr Error toError(const Result &r) noexcept { } } - -constexpr void oxIgnoreError(const ox::Error&) noexcept {} -template -constexpr void oxIgnoreError(const ox::Result&) noexcept {} diff --git a/deps/ox/src/ox/std/fmt.hpp b/deps/ox/src/ox/std/fmt.hpp index 2fd12932..fe714084 100644 --- a/deps/ox/src/ox/std/fmt.hpp +++ b/deps/ox/src/ox/std/fmt.hpp @@ -18,6 +18,7 @@ #include "realstd.hpp" #include "error.hpp" +#include "ignore.hpp" #include "bstring.hpp" #include "string.hpp" #include "strops.hpp" @@ -191,12 +192,12 @@ constexpr StringType sfmt(StringView fmt, Args&&... args) noexcept { StringType out; const auto fmtSegments = ox::detail::fmtSegments(fmt); const auto &firstSegment = fmtSegments.segments[0]; - oxIgnoreError(out.append(firstSegment.str, firstSegment.length)); + std::ignore = out.append(firstSegment.str, firstSegment.length); const detail::FmtArg elements[sizeof...(args)] = {args...}; for (size_t i = 0; i < fmtSegments.size - 1; ++i) { out += elements[i].out; const auto &s = fmtSegments.segments[i + 1]; - oxIgnoreError(out.append(s.str, s.length)); + std::ignore = out.append(s.str, s.length); } return out; } diff --git a/deps/ox/src/ox/std/hashmap.hpp b/deps/ox/src/ox/std/hashmap.hpp index ff42e016..7ddee6c3 100644 --- a/deps/ox/src/ox/std/hashmap.hpp +++ b/deps/ox/src/ox/std/hashmap.hpp @@ -9,6 +9,7 @@ #pragma once #include "algorithm.hpp" +#include "ignore.hpp" #include "stringview.hpp" #include "strops.hpp" #include "vector.hpp" @@ -175,13 +176,13 @@ constexpr void HashMap::erase(MaybeView_t const&k) { while (true) { const auto &p = m_pairs[h]; if (p == nullptr || p->key == k) { - oxIgnoreError(m_pairs.erase(h)); + std::ignore = m_pairs.erase(h); break; } else { h = hash(h) % m_pairs.size(); } } - oxIgnoreError(m_keys.erase(ox::find(m_keys.begin(), m_keys.end(), k))); + std::ignore = m_keys.erase(ox::find(m_keys.begin(), m_keys.end(), k)); } template diff --git a/deps/ox/src/ox/std/string.hpp b/deps/ox/src/ox/std/string.hpp index f8b98159..20ebeeaa 100644 --- a/deps/ox/src/ox/std/string.hpp +++ b/deps/ox/src/ox/std/string.hpp @@ -13,6 +13,7 @@ #endif #include "algorithm.hpp" +#include "ignore.hpp" #include "memops.hpp" #include "serialize.hpp" #include "stringliteral.hpp" @@ -33,9 +34,6 @@ class BasicString { constexpr explicit BasicString(std::size_t cap) noexcept; - template - constexpr BasicString(char const (&str)[Sz]) noexcept; - constexpr explicit BasicString(const char *str) noexcept; constexpr explicit BasicString(const char8_t *str) noexcept; @@ -364,7 +362,7 @@ constexpr BasicString &BasicString::operat template constexpr BasicString &BasicString::operator+=(const char *str) noexcept { std::size_t strLen = ox::strlen(str); - oxIgnoreError(append(str, strLen)); + std::ignore = append(str, strLen); return *this; } @@ -389,13 +387,13 @@ constexpr BasicString &BasicString::operat template constexpr BasicString &BasicString::operator+=(StringView s) noexcept { std::size_t strLen = s.bytes(); - oxIgnoreError(append(s.data(), strLen)); + std::ignore = append(s.data(), strLen); return *this; } template constexpr BasicString &BasicString::operator+=(BasicString const&src) noexcept { - oxIgnoreError(append(src.c_str(), src.len())); + std::ignore = append(src.c_str(), src.len()); return *this; } diff --git a/deps/ox/src/ox/std/trace.cpp b/deps/ox/src/ox/std/trace.cpp index fa16d839..472c594e 100644 --- a/deps/ox/src/ox/std/trace.cpp +++ b/deps/ox/src/ox/std/trace.cpp @@ -37,7 +37,7 @@ void setLogger(Logger *logger) noexcept { } void send(const TraceMsg &msg) noexcept { - oxIgnoreError(logger->send(msg)); + std::ignore = logger->send(msg); } } diff --git a/deps/ox/src/ox/std/trace.hpp b/deps/ox/src/ox/std/trace.hpp index c0c9ebed..5740ccad 100644 --- a/deps/ox/src/ox/std/trace.hpp +++ b/deps/ox/src/ox/std/trace.hpp @@ -148,12 +148,12 @@ class OutStream { m_msg.line = line; m_msg.ch = ch; const auto &firstSegment = fmtSegments.segments[0]; - oxIgnoreError(m_msg.msg.append(firstSegment.str, firstSegment.length)); + std::ignore = m_msg.msg.append(firstSegment.str, firstSegment.length); //const detail::FmtArg elements[sizeof...(args)] = {args...}; for (size_t i = 0; auto const&e : std::initializer_list{elements...}) { m_msg.msg += e.out; const auto &s = fmtSegments.segments[i + 1]; - oxIgnoreError(m_msg.msg.append(s.str, s.length)); + std::ignore = m_msg.msg.append(s.str, s.length); ++i; } } diff --git a/deps/ox/src/ox/std/uuid.hpp b/deps/ox/src/ox/std/uuid.hpp index b7b5a140..5b910059 100644 --- a/deps/ox/src/ox/std/uuid.hpp +++ b/deps/ox/src/ox/std/uuid.hpp @@ -155,7 +155,7 @@ class UUID { for (auto i = 0u; i < cnt; ++i) { const auto v = value[valueI]; const auto h = detail::toHex(v); - oxIgnoreError(writer.write(h.c_str(), h.len())); + std::ignore = writer.write(h.c_str(), h.len()); ++valueI; } }; @@ -175,7 +175,7 @@ class UUID { constexpr UUIDStr toString() const noexcept { UUIDStr out; ox::CharBuffWriter bw(out.data(), out.cap()); - oxIgnoreError(toString(bw)); + std::ignore = toString(bw); out[out.cap()] = 0; return out; }