Squashed 'deps/nostalgia/' changes from f128664a..b75bbc4d
b75bbc4d [olympic,nostalgia] Change order of oxModelFieldRename args 227dd68a [ox/model] Change order of oxModelFieldRename args 02db760b [olympic] Add more ImGui helpers, studio::Editor::pushCommand 09c57545 [ox/std] Add Vector::at git-subtree-dir: deps/nostalgia git-subtree-split: b75bbc4d200c0f4187f5c4068ba686dad34820cd
This commit is contained in:
2
deps/ox/src/ox/model/def.hpp
vendored
2
deps/ox/src/ox/model/def.hpp
vendored
@ -13,5 +13,5 @@
|
||||
#define oxModelBegin(modelName) constexpr ox::Error model(auto *io, [[maybe_unused]] ox::CommonPtrWith<modelName> auto *o) noexcept { oxReturnError(io->template setTypeInfo<modelName>());
|
||||
#define oxModelEnd() return OxError(0); }
|
||||
#define oxModelField(fieldName) oxReturnError(io->field(#fieldName, &o->fieldName));
|
||||
#define oxModelFieldRename(serFieldName, objFieldName) oxReturnError(io->field(#serFieldName, &o->objFieldName));
|
||||
#define oxModelFieldRename(objFieldName, serFieldName) oxReturnError(io->field(#serFieldName, &o->objFieldName));
|
||||
#define oxModelFriend(modelName) friend constexpr ox::Error model(auto*, ox::CommonPtrWith<modelName> auto*) noexcept
|
||||
|
22
deps/ox/src/ox/std/vector.hpp
vendored
22
deps/ox/src/ox/std/vector.hpp
vendored
@ -221,6 +221,12 @@ class Vector: detail::VectorAllocator<T, Allocator, SmallVectorSize> {
|
||||
|
||||
constexpr const T &operator[](std::size_t i) const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Result<T*> at(size_t i) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Result<T const*> at(size_t i) const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Result<T*> front() noexcept;
|
||||
|
||||
@ -416,6 +422,22 @@ constexpr const T &Vector<T, SmallVectorSize, Allocator>::operator[](std::size_t
|
||||
return m_items[i];
|
||||
}
|
||||
|
||||
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
||||
constexpr Result<T*> Vector<T, SmallVectorSize, Allocator>::at(size_t i) noexcept {
|
||||
if (i < size()) {
|
||||
return &operator[](i);
|
||||
}
|
||||
return OxError(1, "Vector: Invalid index");
|
||||
}
|
||||
|
||||
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
||||
constexpr Result<T const*> Vector<T, SmallVectorSize, Allocator>::at(size_t i) const noexcept {
|
||||
if (i < size()) {
|
||||
return &operator[](i);
|
||||
}
|
||||
return OxError(1, "Vector: Invalid index");
|
||||
}
|
||||
|
||||
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
||||
constexpr Result<T*> Vector<T, SmallVectorSize, Allocator>::front() noexcept {
|
||||
if (!m_size) {
|
||||
|
Reference in New Issue
Block a user