[ox] Remove oxIgnoreError
This commit is contained in:
parent
e9a6a09629
commit
ea1feb726e
4
deps/ox/src/ox/claw/write.hpp
vendored
4
deps/ox/src/ox/claw/write.hpp
vendored
@ -61,14 +61,14 @@ struct type_version<T, decltype((void) T::TypeVersion, -1)> {
|
||||
template<typename T>
|
||||
constexpr const char *getTypeName(const T *t) noexcept {
|
||||
TypeInfoCatcher tnc;
|
||||
oxIgnoreError(model(&tnc, t));
|
||||
std::ignore = model(&tnc, t);
|
||||
return tnc.name;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
constexpr int getTypeVersion(const T *t) noexcept {
|
||||
TypeInfoCatcher tnc;
|
||||
oxIgnoreError(model(&tnc, t));
|
||||
std::ignore = model(&tnc, t);
|
||||
return tnc.version;
|
||||
}
|
||||
|
||||
|
2
deps/ox/src/ox/event/signal.hpp
vendored
2
deps/ox/src/ox/event/signal.hpp
vendored
@ -391,7 +391,7 @@ Error Signal<Error(Args...)>::disconnectObject(const void *receiver) const noexc
|
||||
template<class... Args>
|
||||
void Signal<Error(Args...)>::emit(Args... args) const noexcept {
|
||||
for (auto &f : m_slots) {
|
||||
oxIgnoreError(f->call(ox::forward<Args>(args)...));
|
||||
std::ignore = f->call(ox::forward<Args>(args)...);
|
||||
}
|
||||
}
|
||||
|
||||
|
2
deps/ox/src/ox/logconn/logconn.cpp
vendored
2
deps/ox/src/ox/logconn/logconn.cpp
vendored
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
12
deps/ox/src/ox/model/modelops.hpp
vendored
12
deps/ox/src/ox/model/modelops.hpp
vendored
@ -276,8 +276,8 @@ constexpr void moveModel(T *dst, T *src) noexcept {
|
||||
constexpr auto size = ModelFieldCount_v<T>;
|
||||
detail::MemberList<size> dstFields;
|
||||
detail::Mover<size> mover(&dstFields);
|
||||
oxIgnoreError(model(&dstFields, dst));
|
||||
oxIgnoreError(model(&mover, src));
|
||||
std::ignore = model(&dstFields, dst);
|
||||
std::ignore = model(&mover, src);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@ -285,8 +285,8 @@ constexpr void copyModel(T *dst, const T *src) noexcept {
|
||||
constexpr auto size = ModelFieldCount_v<T>;
|
||||
detail::MemberList<size> dstFields;
|
||||
detail::Copier<size> copier(&dstFields);
|
||||
oxIgnoreError(model(&dstFields, dst));
|
||||
oxIgnoreError(model(&copier, src));
|
||||
std::ignore = model(&dstFields, dst);
|
||||
std::ignore = model(&copier, src);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@ -295,8 +295,8 @@ constexpr bool equalsModel(T *a, T *b) noexcept {
|
||||
constexpr auto size = T::Fields;
|
||||
detail::MemberList<size> aFields;
|
||||
detail::Equals<size> equals(&aFields);
|
||||
oxIgnoreError(model(&aFields, a));
|
||||
oxIgnoreError(model(&equals, b));
|
||||
std::ignore = model(&aFields, a);
|
||||
std::ignore = model(&equals, b);
|
||||
return equals.value;
|
||||
}
|
||||
|
||||
|
4
deps/ox/src/ox/model/modelvalue.hpp
vendored
4
deps/ox/src/ox/model/modelvalue.hpp
vendored
@ -1057,13 +1057,13 @@ constexpr ModelValue::ModelValue(ModelValue &&other) noexcept {
|
||||
template<typename T>
|
||||
constexpr ModelValue::ModelValue(const T &val) noexcept
|
||||
requires(!ox::is_same_v<ox::remove_reference_t<T>, ModelValue>) {
|
||||
oxIgnoreError(set(val));
|
||||
std::ignore = set(val);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
constexpr ModelValue::ModelValue(T &&val) noexcept
|
||||
requires(!ox::is_same_v<ox::remove_reference_t<T>, ModelValue>) {
|
||||
oxIgnoreError(set(ox::forward<T>(val)));
|
||||
std::ignore = set(ox::forward<T>(val));
|
||||
}
|
||||
|
||||
constexpr ModelValue::~ModelValue() noexcept {
|
||||
|
4
deps/ox/src/ox/model/typenamecatcher.hpp
vendored
4
deps/ox/src/ox/model/typenamecatcher.hpp
vendored
@ -99,7 +99,7 @@ struct TypeInfoCatcher {
|
||||
template<typename T>
|
||||
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<typename T, typename Str = const char*>
|
||||
constexpr Str getModelTypeName(T *val) noexcept {
|
||||
TypeNameCatcher nc;
|
||||
oxIgnoreError(model(&nc, val));
|
||||
std::ignore = model(&nc, val);
|
||||
return nc.name;
|
||||
}
|
||||
|
||||
|
7
deps/ox/src/ox/std/bstring.hpp
vendored
7
deps/ox/src/ox/std/bstring.hpp
vendored
@ -8,6 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ignore.hpp"
|
||||
#include "memops.hpp"
|
||||
#include "stringview.hpp"
|
||||
#include "strops.hpp"
|
||||
@ -145,7 +146,7 @@ constexpr BString<size> &BString<size>::operator=(char *str) noexcept {
|
||||
template<std::size_t size>
|
||||
constexpr BString<size> &BString<size>::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<size> &BString<size>::operator+=(Integer_c auto i) noexcept {
|
||||
template<std::size_t size>
|
||||
constexpr BString<size> &BString<size>::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<std::size_t size>
|
||||
constexpr BString<size> BString<size>::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;
|
||||
}
|
||||
|
||||
|
4
deps/ox/src/ox/std/error.hpp
vendored
4
deps/ox/src/ox/std/error.hpp
vendored
@ -314,7 +314,3 @@ constexpr Error toError(const Result<T> &r) noexcept {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
constexpr void oxIgnoreError(const ox::Error&) noexcept {}
|
||||
template<typename T>
|
||||
constexpr void oxIgnoreError(const ox::Result<T>&) noexcept {}
|
||||
|
5
deps/ox/src/ox/std/fmt.hpp
vendored
5
deps/ox/src/ox/std/fmt.hpp
vendored
@ -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<sizeof...(args)+1>(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;
|
||||
}
|
||||
|
5
deps/ox/src/ox/std/hashmap.hpp
vendored
5
deps/ox/src/ox/std/hashmap.hpp
vendored
@ -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<K, T>::erase(MaybeView_t<K> 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<typename K, typename T>
|
||||
|
10
deps/ox/src/ox/std/string.hpp
vendored
10
deps/ox/src/ox/std/string.hpp
vendored
@ -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<size_t Sz>
|
||||
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<SmallStringSize_v> &BasicString<SmallStringSize_v>::operat
|
||||
template<std::size_t SmallStringSize_v>
|
||||
constexpr BasicString<SmallStringSize_v> &BasicString<SmallStringSize_v>::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<SmallStringSize_v> &BasicString<SmallStringSize_v>::operat
|
||||
template<std::size_t SmallStringSize_v>
|
||||
constexpr BasicString<SmallStringSize_v> &BasicString<SmallStringSize_v>::operator+=(StringView s) noexcept {
|
||||
std::size_t strLen = s.bytes();
|
||||
oxIgnoreError(append(s.data(), strLen));
|
||||
std::ignore = append(s.data(), strLen);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<std::size_t SmallStringSize_v>
|
||||
constexpr BasicString<SmallStringSize_v> &BasicString<SmallStringSize_v>::operator+=(BasicString const&src) noexcept {
|
||||
oxIgnoreError(append(src.c_str(), src.len()));
|
||||
std::ignore = append(src.c_str(), src.len());
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
2
deps/ox/src/ox/std/trace.cpp
vendored
2
deps/ox/src/ox/std/trace.cpp
vendored
@ -37,7 +37,7 @@ void setLogger(Logger *logger) noexcept {
|
||||
}
|
||||
|
||||
void send(const TraceMsg &msg) noexcept {
|
||||
oxIgnoreError(logger->send(msg));
|
||||
std::ignore = logger->send(msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
4
deps/ox/src/ox/std/trace.hpp
vendored
4
deps/ox/src/ox/std/trace.hpp
vendored
@ -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<detail::FmtArg>{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;
|
||||
}
|
||||
}
|
||||
|
4
deps/ox/src/ox/std/uuid.hpp
vendored
4
deps/ox/src/ox/std/uuid.hpp
vendored
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user