Compare commits
2 Commits
cc0da5dd6a
...
b6f86551e9
Author | SHA1 | Date | |
---|---|---|---|
b6f86551e9 | |||
1a7e551025 |
10
deps/ox/src/ox/std/assert.hpp
vendored
10
deps/ox/src/ox/std/assert.hpp
vendored
@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
namespace ox {
|
namespace ox {
|
||||||
|
|
||||||
void panic(const char *file, int line, const char *panicMsg, const Error &err = OxError(0)) noexcept;
|
void panic(CRStringView file, int line, CRStringView panicMsg, const Error &err = OxError(0)) noexcept;
|
||||||
|
|
||||||
constexpr void constexprPanic(const char *file, int line, const char *panicMsg, const Error &err = OxError(0)) noexcept {
|
constexpr void constexprPanic(CRStringView file, int line, CRStringView panicMsg, const Error &err = OxError(0)) noexcept {
|
||||||
if (!std::is_constant_evaluated()) {
|
if (!std::is_constant_evaluated()) {
|
||||||
panic(file, line, panicMsg, err);
|
panic(file, line, panicMsg, err);
|
||||||
} else {
|
} else {
|
||||||
@ -32,7 +32,7 @@ constexpr void constexprPanic(const char *file, int line, const char *panicMsg,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void assertFunc(const char *file, int line, bool pass, [[maybe_unused]]const char *assertTxt, [[maybe_unused]]const char *msg) noexcept {
|
constexpr void assertFunc(CRStringView file, int line, bool pass, [[maybe_unused]]CRStringView assertTxt, [[maybe_unused]]CRStringView msg) noexcept {
|
||||||
if (!pass) {
|
if (!pass) {
|
||||||
if (!std::is_constant_evaluated()) {
|
if (!std::is_constant_evaluated()) {
|
||||||
#ifdef OX_USE_STDLIB
|
#ifdef OX_USE_STDLIB
|
||||||
@ -51,7 +51,7 @@ constexpr void assertFunc(const char *file, int line, bool pass, [[maybe_unused]
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void assertFunc(const char *file, int line, const Error &err, const char*, const char *assertMsg) noexcept {
|
constexpr void assertFunc(CRStringView file, int line, const Error &err, CRStringView, CRStringView assertMsg) noexcept {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (!std::is_constant_evaluated()) {
|
if (!std::is_constant_evaluated()) {
|
||||||
#if defined(OX_USE_STDLIB)
|
#if defined(OX_USE_STDLIB)
|
||||||
@ -75,7 +75,7 @@ constexpr void assertFunc(const char *file, int line, const Error &err, const ch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void expect(const char *file, int line, const auto &actual, const auto &expected) noexcept {
|
constexpr void expect(CRStringView file, int line, const auto &actual, const auto &expected) noexcept {
|
||||||
if (actual != expected) {
|
if (actual != expected) {
|
||||||
if (!std::is_constant_evaluated()) {
|
if (!std::is_constant_evaluated()) {
|
||||||
#if defined(OX_USE_STDLIB)
|
#if defined(OX_USE_STDLIB)
|
||||||
|
16
deps/ox/src/ox/std/vector.hpp
vendored
16
deps/ox/src/ox/std/vector.hpp
vendored
@ -357,13 +357,13 @@ class Vector: detail::VectorAllocator<T, Allocator, SmallVectorSize> {
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr bool contains(const T&) const noexcept(useNoexcept);
|
constexpr bool contains(const T&) const noexcept(useNoexcept);
|
||||||
|
|
||||||
constexpr iterator<> insert(
|
constexpr iterator<T&, T*, false> insert(
|
||||||
std::size_t pos, std::size_t cnt, const T &val) noexcept(useNoexcept);
|
std::size_t pos, std::size_t cnt, const T &val) noexcept(useNoexcept);
|
||||||
|
|
||||||
constexpr iterator<> insert(std::size_t pos, const T &val) noexcept(useNoexcept);
|
constexpr iterator<T&, T*, false> insert(std::size_t pos, const T &val) noexcept(useNoexcept);
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
constexpr iterator<> emplace(std::size_t pos, Args&&... args) noexcept(useNoexcept);
|
constexpr iterator<T&, T*, false> emplace(std::size_t pos, Args&&... args) noexcept(useNoexcept);
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
constexpr T &emplace_back(Args&&... args) noexcept(useNoexcept);
|
constexpr T &emplace_back(Args&&... args) noexcept(useNoexcept);
|
||||||
@ -377,14 +377,14 @@ class Vector: detail::VectorAllocator<T, Allocator, SmallVectorSize> {
|
|||||||
* @param pos iterator at the point to remove
|
* @param pos iterator at the point to remove
|
||||||
* @return Error if index is out of bounds
|
* @return Error if index is out of bounds
|
||||||
*/
|
*/
|
||||||
constexpr Result<iterator<>> erase(const iterator<> &pos) noexcept(useNoexcept);
|
constexpr Result<iterator<T&, T*, false>> erase(const iterator<> &pos) noexcept(useNoexcept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes an item from the Vector.
|
* Removes an item from the Vector.
|
||||||
* @param pos position of item to remove
|
* @param pos position of item to remove
|
||||||
* @return Error if index is out of bounds
|
* @return Error if index is out of bounds
|
||||||
*/
|
*/
|
||||||
constexpr Result<iterator<>> erase(std::size_t pos) noexcept(useNoexcept);
|
constexpr Result<iterator<T&, T*, false>> erase(std::size_t pos) noexcept(useNoexcept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the last item in the Vector to position pos and decrements the
|
* Moves the last item in the Vector to position pos and decrements the
|
||||||
@ -595,7 +595,7 @@ constexpr bool Vector<T, SmallVectorSize, Allocator>::contains(const T &v) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
||||||
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<>
|
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<T&, T*, false>
|
||||||
Vector<T, SmallVectorSize, Allocator>::insert(
|
Vector<T, SmallVectorSize, Allocator>::insert(
|
||||||
std::size_t pos, std::size_t cnt, const T &val) noexcept(useNoexcept) {
|
std::size_t pos, std::size_t cnt, const T &val) noexcept(useNoexcept) {
|
||||||
if (m_size + cnt > m_cap) {
|
if (m_size + cnt > m_cap) {
|
||||||
@ -624,7 +624,7 @@ Vector<T, SmallVectorSize, Allocator>::insert(
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
||||||
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<>
|
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<T&, T*, false>
|
||||||
Vector<T, SmallVectorSize, Allocator>::insert(std::size_t pos, const T &val) noexcept(useNoexcept) {
|
Vector<T, SmallVectorSize, Allocator>::insert(std::size_t pos, const T &val) noexcept(useNoexcept) {
|
||||||
if (m_size == m_cap) {
|
if (m_size == m_cap) {
|
||||||
reserveInsert(m_cap ? m_cap * 2 : initialCap, pos);
|
reserveInsert(m_cap ? m_cap * 2 : initialCap, pos);
|
||||||
@ -649,7 +649,7 @@ Vector<T, SmallVectorSize, Allocator>::insert(std::size_t pos, const T &val) noe
|
|||||||
|
|
||||||
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<>
|
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<T&, T*, false>
|
||||||
Vector<T, SmallVectorSize, Allocator>::emplace(std::size_t pos, Args&&... args) noexcept(useNoexcept) {
|
Vector<T, SmallVectorSize, Allocator>::emplace(std::size_t pos, Args&&... args) noexcept(useNoexcept) {
|
||||||
if (m_size == m_cap) {
|
if (m_size == m_cap) {
|
||||||
reserveInsert(m_cap ? m_cap * 2 : initialCap, pos);
|
reserveInsert(m_cap ? m_cap * 2 : initialCap, pos);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user