[ox] Fix some template issue that come up with some versions of Clang, fix empty string read in OC
This commit is contained in:
parent
1b93b2038f
commit
960889749d
9
deps/ox/src/ox/mc/read.hpp
vendored
9
deps/ox/src/ox/mc/read.hpp
vendored
@ -27,7 +27,7 @@
|
|||||||
namespace ox {
|
namespace ox {
|
||||||
|
|
||||||
template<Reader_c Reader>
|
template<Reader_c Reader>
|
||||||
class MetalClawReaderTemplate: public ModelHandlerBase<MetalClawReaderTemplate<Reader>> {
|
class MetalClawReaderTemplate: public ModelHandlerBase<MetalClawReaderTemplate<Reader>, ox::OpType::Read> {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FieldBitmapReader<Reader> m_fieldPresence;
|
FieldBitmapReader<Reader> m_fieldPresence;
|
||||||
@ -127,11 +127,6 @@ class MetalClawReaderTemplate: public ModelHandlerBase<MetalClawReaderTemplate<R
|
|||||||
|
|
||||||
constexpr void nextField() noexcept;
|
constexpr void nextField() noexcept;
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
static constexpr auto opType() noexcept {
|
|
||||||
return OpType::Read;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename I>
|
template<typename I>
|
||||||
constexpr Error readInteger(I *val) noexcept;
|
constexpr Error readInteger(I *val) noexcept;
|
||||||
@ -533,7 +528,7 @@ template<typename T>
|
|||||||
Error readMC(const char *buff, std::size_t buffLen, T *val) noexcept {
|
Error readMC(const char *buff, std::size_t buffLen, T *val) noexcept {
|
||||||
BufferReader br(buff, buffLen);
|
BufferReader br(buff, buffLen);
|
||||||
MetalClawReader reader(br);
|
MetalClawReader reader(br);
|
||||||
ModelHandlerInterface handler(&reader);
|
ModelHandlerInterface<MetalClawReader, ox::OpType::Read> handler(&reader);
|
||||||
return model(&handler, val);
|
return model(&handler, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
deps/ox/src/ox/model/descwrite.hpp
vendored
4
deps/ox/src/ox/model/descwrite.hpp
vendored
@ -357,7 +357,7 @@ constexpr const DescriptorType *TypeDescWriter::getType(CRStringView tn, int typ
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr Result<DescriptorType*> buildTypeDef(TypeStore *typeStore) noexcept {
|
constexpr Result<DescriptorType*> buildTypeDef(TypeStore *typeStore) noexcept {
|
||||||
TypeDescWriter writer(typeStore);
|
TypeDescWriter writer(typeStore);
|
||||||
ModelHandlerInterface handler(&writer);
|
ModelHandlerInterface<TypeDescWriter, ox::OpType::Reflect> handler(&writer);
|
||||||
if (std::is_constant_evaluated()) {
|
if (std::is_constant_evaluated()) {
|
||||||
std::allocator<T> a;
|
std::allocator<T> a;
|
||||||
T *t = a.allocate(1);
|
T *t = a.allocate(1);
|
||||||
@ -373,7 +373,7 @@ constexpr Result<DescriptorType*> buildTypeDef(TypeStore *typeStore) noexcept {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr Result<DescriptorType*> buildTypeDef(TypeStore *typeStore, T *val) noexcept {
|
constexpr Result<DescriptorType*> buildTypeDef(TypeStore *typeStore, T *val) noexcept {
|
||||||
TypeDescWriter writer(typeStore);
|
TypeDescWriter writer(typeStore);
|
||||||
ModelHandlerInterface handler(&writer);
|
ModelHandlerInterface<TypeDescWriter, ox::OpType::Reflect> handler(&writer);
|
||||||
oxReturnError(model(&handler, val));
|
oxReturnError(model(&handler, val));
|
||||||
return writer.definition();
|
return writer.definition();
|
||||||
}
|
}
|
||||||
|
21
deps/ox/src/ox/model/modelhandleradaptor.hpp
vendored
21
deps/ox/src/ox/model/modelhandleradaptor.hpp
vendored
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace ox {
|
namespace ox {
|
||||||
|
|
||||||
template<typename Handler>
|
template<typename Handler, OpType opType_v = Handler::opType()>
|
||||||
class ModelHandlerInterface {
|
class ModelHandlerInterface {
|
||||||
private:
|
private:
|
||||||
Handler *m_handler = nullptr;
|
Handler *m_handler = nullptr;
|
||||||
@ -46,7 +46,7 @@ class ModelHandlerInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<std::size_t len>
|
template<std::size_t len>
|
||||||
constexpr Error fieldCString(const char *name, const char val[len]) noexcept requires(Handler::opType() != OpType::Read) {
|
constexpr Error fieldCString(const char *name, const char val[len]) noexcept requires(opType_v != OpType::Read) {
|
||||||
return m_handler->fieldCString(name, &val[0], len);
|
return m_handler->fieldCString(name, &val[0], len);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,11 +54,11 @@ class ModelHandlerInterface {
|
|||||||
return m_handler->fieldCString(name, val);
|
return m_handler->fieldCString(name, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Error fieldCString(const char *name, const char *const*val) noexcept requires(Handler::opType() != OpType::Read) {
|
constexpr Error fieldCString(const char *name, const char *const*val) noexcept requires(opType_v != OpType::Read) {
|
||||||
return m_handler->fieldCString(name, val);
|
return m_handler->fieldCString(name, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Error fieldCString(const char *name, const char **val) noexcept requires(Handler::opType() != OpType::Read) {
|
constexpr Error fieldCString(const char *name, const char **val) noexcept requires(opType_v != OpType::Read) {
|
||||||
return m_handler->fieldCString(name, val);
|
return m_handler->fieldCString(name, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ class ModelHandlerInterface {
|
|||||||
return m_handler->fieldCString(name, val, buffLen);
|
return m_handler->fieldCString(name, val, buffLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Error fieldCString(const char *name, const char **val, std::size_t buffLen) noexcept requires(Handler::opType() != OpType::Read) {
|
constexpr Error fieldCString(const char *name, const char **val, std::size_t buffLen) noexcept requires(opType_v != OpType::Read) {
|
||||||
return m_handler->fieldCString(name, val, buffLen);
|
return m_handler->fieldCString(name, val, buffLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ class ModelHandlerInterface {
|
|||||||
case ModelValue::Type::Union:
|
case ModelValue::Type::Union:
|
||||||
{
|
{
|
||||||
auto &u = v->template get<ModelUnion>();
|
auto &u = v->template get<ModelUnion>();
|
||||||
if constexpr(Handler::opType() == OpType::Read) {
|
if constexpr(opType_v == OpType::Read) {
|
||||||
u.setActiveField(m_handler->whichFieldPresent(name, u));
|
u.setActiveField(m_handler->whichFieldPresent(name, u));
|
||||||
return m_handler->field(name, UnionView<ModelUnion, true>(&u, u.unionIdx()));
|
return m_handler->field(name, UnionView<ModelUnion, true>(&u, u.unionIdx()));
|
||||||
} else {
|
} else {
|
||||||
@ -180,10 +180,10 @@ class ModelHandlerInterface {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Handler>
|
template<typename Handler, ox::OpType opType_v = Handler::opType()>
|
||||||
class ModelHandlerBase {
|
class ModelHandlerBase {
|
||||||
private:
|
private:
|
||||||
ModelHandlerInterface<Handler> m_interface;
|
ModelHandlerInterface<Handler, opType_v> m_interface;
|
||||||
public:
|
public:
|
||||||
constexpr ModelHandlerBase() noexcept: m_interface(static_cast<Handler*>(this)) {}
|
constexpr ModelHandlerBase() noexcept: m_interface(static_cast<Handler*>(this)) {}
|
||||||
constexpr ModelHandlerBase(const ModelHandlerBase&) noexcept: m_interface(static_cast<Handler*>(this)) {}
|
constexpr ModelHandlerBase(const ModelHandlerBase&) noexcept: m_interface(static_cast<Handler*>(this)) {}
|
||||||
@ -192,6 +192,11 @@ class ModelHandlerBase {
|
|||||||
constexpr auto interface() noexcept {
|
constexpr auto interface() noexcept {
|
||||||
return &m_interface;
|
return &m_interface;
|
||||||
}
|
}
|
||||||
|
[[nodiscard]]
|
||||||
|
static constexpr ox::OpType opType() noexcept {
|
||||||
|
return opType_v;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
2
deps/ox/src/ox/oc/read.hpp
vendored
2
deps/ox/src/ox/oc/read.hpp
vendored
@ -194,7 +194,7 @@ Error OrganicClawReader::field(const char *key, BasicString<L> *val) noexcept {
|
|||||||
if (targetValid()) {
|
if (targetValid()) {
|
||||||
const auto &jv = value(key);
|
const auto &jv = value(key);
|
||||||
if (jv.empty()) {
|
if (jv.empty()) {
|
||||||
*val = 0;
|
*val = BasicString<L>{};
|
||||||
} else if (jv.isString()) {
|
} else if (jv.isString()) {
|
||||||
*val = jv.asString().c_str();
|
*val = jv.asString().c_str();
|
||||||
} else {
|
} else {
|
||||||
|
10
deps/ox/src/ox/oc/write.hpp
vendored
10
deps/ox/src/ox/oc/write.hpp
vendored
@ -117,7 +117,7 @@ class OrganicClawWriter {
|
|||||||
if (targetValid()) {
|
if (targetValid()) {
|
||||||
const auto &keys = val->keys();
|
const auto &keys = val->keys();
|
||||||
OrganicClawWriter w;
|
OrganicClawWriter w;
|
||||||
ModelHandlerInterface handler{&w};
|
ModelHandlerInterface<OrganicClawWriter, OpType::Write> handler{&w};
|
||||||
for (std::size_t i = 0; i < keys.size(); ++i) {
|
for (std::size_t i = 0; i < keys.size(); ++i) {
|
||||||
const auto k = keys[i].c_str();
|
const auto k = keys[i].c_str();
|
||||||
if (k) [[likely]] {
|
if (k) [[likely]] {
|
||||||
@ -197,7 +197,7 @@ template<typename T>
|
|||||||
Error OrganicClawWriter::field(const char *key, const T *val, std::size_t len) noexcept {
|
Error OrganicClawWriter::field(const char *key, const T *val, std::size_t len) noexcept {
|
||||||
if (targetValid() && len) {
|
if (targetValid() && len) {
|
||||||
OrganicClawWriter w((Json::Value(Json::arrayValue)));
|
OrganicClawWriter w((Json::Value(Json::arrayValue)));
|
||||||
ModelHandlerInterface handler{&w};
|
ModelHandlerInterface<OrganicClawWriter, OpType::Write> handler{&w};
|
||||||
for (std::size_t i = 0; i < len; ++i) {
|
for (std::size_t i = 0; i < len; ++i) {
|
||||||
oxReturnError(handler.field("", &val[i]));
|
oxReturnError(handler.field("", &val[i]));
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ Error OrganicClawWriter::field(const char *key, const T *val) noexcept {
|
|||||||
return field(key, val->data(), val->size());
|
return field(key, val->data(), val->size());
|
||||||
} else if (val && targetValid()) {
|
} else if (val && targetValid()) {
|
||||||
OrganicClawWriter w;
|
OrganicClawWriter w;
|
||||||
ModelHandlerInterface handler{&w};
|
ModelHandlerInterface<OrganicClawWriter, OpType::Write> handler{&w};
|
||||||
oxReturnError(model(&handler, val));
|
oxReturnError(model(&handler, val));
|
||||||
if (!w.m_json.isNull()) {
|
if (!w.m_json.isNull()) {
|
||||||
value(key) = w.m_json;
|
value(key) = w.m_json;
|
||||||
@ -227,7 +227,7 @@ template<typename U, bool force>
|
|||||||
Error OrganicClawWriter::field(const char *key, UnionView<U, force> val) noexcept {
|
Error OrganicClawWriter::field(const char *key, UnionView<U, force> val) noexcept {
|
||||||
if (targetValid()) {
|
if (targetValid()) {
|
||||||
OrganicClawWriter w(val.idx());
|
OrganicClawWriter w(val.idx());
|
||||||
ModelHandlerInterface handler{&w};
|
ModelHandlerInterface<OrganicClawWriter, OpType::Write> handler{&w};
|
||||||
oxReturnError(model(&handler, val.get()));
|
oxReturnError(model(&handler, val.get()));
|
||||||
if (!w.m_json.isNull()) {
|
if (!w.m_json.isNull()) {
|
||||||
value(key) = w.m_json;
|
value(key) = w.m_json;
|
||||||
@ -239,7 +239,7 @@ Error OrganicClawWriter::field(const char *key, UnionView<U, force> val) noexcep
|
|||||||
|
|
||||||
Result<Buffer> writeOC(const auto &val) noexcept {
|
Result<Buffer> writeOC(const auto &val) noexcept {
|
||||||
OrganicClawWriter writer;
|
OrganicClawWriter writer;
|
||||||
ModelHandlerInterface handler(&writer);
|
ModelHandlerInterface<OrganicClawWriter, OpType::Write> handler(&writer);
|
||||||
oxReturnError(model(&handler, &val));
|
oxReturnError(model(&handler, &val));
|
||||||
Json::StreamWriterBuilder jsonBuilder;
|
Json::StreamWriterBuilder jsonBuilder;
|
||||||
const auto str = Json::writeString(jsonBuilder, writer.m_json);
|
const auto str = Json::writeString(jsonBuilder, writer.m_json);
|
||||||
|
@ -22,7 +22,7 @@ template<typename PlatSpec, typename T>
|
|||||||
constexpr std::size_t sizeOf(const T *t) noexcept;
|
constexpr std::size_t sizeOf(const T *t) noexcept;
|
||||||
|
|
||||||
template<typename PlatSpec>
|
template<typename PlatSpec>
|
||||||
struct AlignmentCatcher: public ModelHandlerBase<AlignmentCatcher<PlatSpec>> {
|
struct AlignmentCatcher: public ModelHandlerBase<AlignmentCatcher<PlatSpec>, OpType::Reflect> {
|
||||||
std::size_t biggestAlignment = 1;
|
std::size_t biggestAlignment = 1;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
@ -64,11 +64,6 @@ struct AlignmentCatcher: public ModelHandlerBase<AlignmentCatcher<PlatSpec>> {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
static constexpr auto opType() noexcept {
|
|
||||||
return ox::OpType::Reflect;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
1
deps/ox/src/ox/preloader/platspecs.hpp
vendored
1
deps/ox/src/ox/preloader/platspecs.hpp
vendored
@ -13,6 +13,7 @@
|
|||||||
namespace ox {
|
namespace ox {
|
||||||
|
|
||||||
struct NativePlatSpec {
|
struct NativePlatSpec {
|
||||||
|
static constexpr std::size_t RomStart = 1024;
|
||||||
using PtrType = uintptr_t;
|
using PtrType = uintptr_t;
|
||||||
using size_t = std::size_t;
|
using size_t = std::size_t;
|
||||||
|
|
||||||
|
2
deps/ox/src/ox/preloader/preloader.cpp
vendored
2
deps/ox/src/ox/preloader/preloader.cpp
vendored
@ -6,4 +6,6 @@
|
|||||||
|
|
||||||
namespace ox {
|
namespace ox {
|
||||||
|
|
||||||
|
template class Preloader<NativePlatSpec>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
12
deps/ox/src/ox/preloader/preloader.hpp
vendored
12
deps/ox/src/ox/preloader/preloader.hpp
vendored
@ -15,7 +15,6 @@
|
|||||||
#include <ox/std/units.hpp>
|
#include <ox/std/units.hpp>
|
||||||
#include <ox/model/modelhandleradaptor.hpp>
|
#include <ox/model/modelhandleradaptor.hpp>
|
||||||
|
|
||||||
#include "preloader.hpp"
|
|
||||||
#include "platspecs.hpp"
|
#include "platspecs.hpp"
|
||||||
|
|
||||||
namespace ox {
|
namespace ox {
|
||||||
@ -24,7 +23,7 @@ template<typename PlatSpec>
|
|||||||
class Preloader;
|
class Preloader;
|
||||||
|
|
||||||
template<typename PlatSpec>
|
template<typename PlatSpec>
|
||||||
class Preloader: public ModelHandlerBase<Preloader<PlatSpec>> {
|
class Preloader: public ModelHandlerBase<Preloader<PlatSpec>, OpType::Reflect> {
|
||||||
private:
|
private:
|
||||||
using PtrType = typename PlatSpec::PtrType;
|
using PtrType = typename PlatSpec::PtrType;
|
||||||
static constexpr auto PtrSize = sizeof(PtrType);
|
static constexpr auto PtrSize = sizeof(PtrType);
|
||||||
@ -115,11 +114,6 @@ class Preloader: public ModelHandlerBase<Preloader<PlatSpec>> {
|
|||||||
return m_buff;
|
return m_buff;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
static constexpr auto opType() noexcept {
|
|
||||||
return ox::OpType::Write;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr ox::Error pad(const T*) noexcept;
|
constexpr ox::Error pad(const T*) noexcept;
|
||||||
|
|
||||||
@ -272,7 +266,7 @@ constexpr ox::Error Preloader<PlatSpec>::endAlloc() noexcept {
|
|||||||
return m_writer.seekp(0, ox::ios_base::end);
|
return m_writer.seekp(0, ox::ios_base::end);
|
||||||
}
|
}
|
||||||
const auto &si = *m_allocStack.back().unwrap();
|
const auto &si = *m_allocStack.back().unwrap();
|
||||||
oxReturnError(m_writer.seekp(si.restore, si.seekdir));
|
oxReturnError(m_writer.seekp(static_cast<ox::ssize_t>(si.restore), si.seekdir));
|
||||||
m_allocStack.pop_back();
|
m_allocStack.pop_back();
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@ -364,4 +358,6 @@ constexpr ox::Error preload(Preloader<PlatSpec> *pl, ox::CommonPtrWith<T> auto *
|
|||||||
return pl->pad(obj);
|
return pl->pad(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern template class Preloader<NativePlatSpec>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
7
deps/ox/src/ox/preloader/sizecatcher.hpp
vendored
7
deps/ox/src/ox/preloader/sizecatcher.hpp
vendored
@ -24,7 +24,7 @@ template<typename PlatSpec, typename T>
|
|||||||
constexpr std::size_t sizeOf(const T *t) noexcept;
|
constexpr std::size_t sizeOf(const T *t) noexcept;
|
||||||
|
|
||||||
template<typename PlatSpec>
|
template<typename PlatSpec>
|
||||||
class SizeCatcher: public ModelHandlerBase<SizeCatcher<PlatSpec>> {
|
class SizeCatcher: public ModelHandlerBase<SizeCatcher<PlatSpec>, OpType::Reflect> {
|
||||||
private:
|
private:
|
||||||
std::size_t m_size = 0;
|
std::size_t m_size = 0;
|
||||||
|
|
||||||
@ -61,11 +61,6 @@ class SizeCatcher: public ModelHandlerBase<SizeCatcher<PlatSpec>> {
|
|||||||
return m_size;
|
return m_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
static constexpr auto opType() noexcept {
|
|
||||||
return ox::OpType::Reflect;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
constexpr void pad(const auto *val) noexcept;
|
constexpr void pad(const auto *val) noexcept;
|
||||||
};
|
};
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
namespace ox {
|
namespace ox {
|
||||||
|
|
||||||
template<typename PlatSpec>
|
template<typename PlatSpec>
|
||||||
class UnionSizeCatcher: public ModelHandlerBase<UnionSizeCatcher<PlatSpec>> {
|
class UnionSizeCatcher: public ModelHandlerBase<UnionSizeCatcher<PlatSpec>, OpType::Reflect> {
|
||||||
private:
|
private:
|
||||||
std::size_t m_size = 0;
|
std::size_t m_size = 0;
|
||||||
|
|
||||||
@ -55,11 +55,6 @@ class UnionSizeCatcher: public ModelHandlerBase<UnionSizeCatcher<PlatSpec>> {
|
|||||||
return m_size;
|
return m_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
static constexpr auto opType() noexcept {
|
|
||||||
return ox::OpType::Reflect;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename T, std::size_t SmallVecSize>
|
template<typename T, std::size_t SmallVecSize>
|
||||||
constexpr ox::Error fieldStr(CRStringView, const ox::BasicString<SmallVecSize> *val) noexcept;
|
constexpr ox::Error fieldStr(CRStringView, const ox::BasicString<SmallVecSize> *val) noexcept;
|
||||||
|
18
deps/ox/src/ox/std/span.hpp
vendored
18
deps/ox/src/ox/std/span.hpp
vendored
@ -28,27 +28,29 @@ class SpanView {
|
|||||||
template<typename RefType = T const&, typename PtrType = T const*, bool reverse = false>
|
template<typename RefType = T const&, typename PtrType = T const*, bool reverse = false>
|
||||||
using iterator = SpanIterator<T, RefType, PtrType, reverse>;
|
using iterator = SpanIterator<T, RefType, PtrType, reverse>;
|
||||||
|
|
||||||
|
constexpr SpanView() noexcept {}
|
||||||
|
|
||||||
template<std::size_t sz>
|
template<std::size_t sz>
|
||||||
constexpr SpanView(ox::Array<T, sz> const&a) noexcept:
|
constexpr SpanView(ox::Array<T, sz> const&a) noexcept:
|
||||||
m_items(a.data()),
|
m_items(a.data()),
|
||||||
m_size(a.size()) {
|
m_size(a.size()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<std::size_t sz, typename Allocator>
|
template<std::size_t sz, typename Allocator>
|
||||||
constexpr SpanView(ox::Vector<T, sz, Allocator> const&v) noexcept:
|
constexpr SpanView(ox::Vector<T, sz, Allocator> const&v) noexcept:
|
||||||
m_items(v.data()),
|
m_items(v.data()),
|
||||||
m_size(v.size()) {
|
m_size(v.size()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<std::size_t sz>
|
template<std::size_t sz>
|
||||||
constexpr SpanView(const T a[sz]) noexcept:
|
constexpr SpanView(const T a[sz]) noexcept:
|
||||||
m_items(a),
|
m_items(a),
|
||||||
m_size(sz) {
|
m_size(sz) {
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr SpanView(const T *a, std::size_t sz) noexcept:
|
constexpr SpanView(const T *a, std::size_t sz) noexcept:
|
||||||
m_items(a),
|
m_items(a),
|
||||||
m_size(sz) {
|
m_size(sz) {
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr iterator<> begin() noexcept {
|
constexpr iterator<> begin() noexcept {
|
||||||
|
2
deps/ox/src/ox/std/types.hpp
vendored
2
deps/ox/src/ox/std/types.hpp
vendored
@ -159,6 +159,8 @@ struct ResizedInt<T, bits, false> {
|
|||||||
template<typename T, std::size_t bits>
|
template<typename T, std::size_t bits>
|
||||||
using ResizedInt_t = typename ResizedInt<T, bits>::type;
|
using ResizedInt_t = typename ResizedInt<T, bits>::type;
|
||||||
|
|
||||||
|
using ssize_t = Signed<std::size_t>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user