[ox] Add Vector/Array/Span overflow checking
This commit is contained in:
9
deps/ox/src/ox/std/error.hpp
vendored
9
deps/ox/src/ox/std/error.hpp
vendored
@ -24,6 +24,7 @@ class exception {
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "defines.hpp"
|
||||
#include "def.hpp"
|
||||
#include "typetraits.hpp"
|
||||
#include "utility.hpp"
|
||||
@ -332,4 +333,12 @@ constexpr Error toError(const Result<T> &r) noexcept {
|
||||
|
||||
}
|
||||
|
||||
constexpr void primitiveAssert(const char *file, int line, bool pass, const char *msg) noexcept {
|
||||
if constexpr(ox::defines::Debug) {
|
||||
if (!pass) [[unlikely]] {
|
||||
panic(file, line, msg, OxError(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user