[ox] Cleanup some const_casts
This commit is contained in:
parent
40a3c28fbf
commit
cd0958c691
2
deps/ox/src/ox/mc/write.hpp
vendored
2
deps/ox/src/ox/mc/write.hpp
vendored
@ -301,7 +301,7 @@ constexpr Error MetalClawWriter<Writer>::field(const char*, const T *val, std::s
|
||||
oxReturnError(handler.template setTypeInfo<T>("List", 0, {}, static_cast<std::size_t>(len)));
|
||||
// write the array
|
||||
for (std::size_t i = 0; i < len; i++) {
|
||||
oxReturnError(handler.field("", const_cast<const T*>(&val[i])));
|
||||
oxReturnError(handler.field("", &val[i]));
|
||||
}
|
||||
oxReturnError(writer.finalize());
|
||||
fieldSet = true;
|
||||
|
4
deps/ox/src/ox/std/error.hpp
vendored
4
deps/ox/src/ox/std/error.hpp
vendored
@ -144,10 +144,10 @@ struct [[nodiscard]] Result {
|
||||
constexpr Result(const Error &error) noexcept: value(), error(error) {
|
||||
}
|
||||
|
||||
constexpr Result(const type &value, const Error &error = OxError(0)) noexcept: value(const_cast<type&>(value)), error(error) {
|
||||
constexpr Result(const type &value, const Error &error = OxError(0)) noexcept: value(value), error(error) {
|
||||
}
|
||||
|
||||
constexpr Result(type &&value, const Error &error = OxError(0)) noexcept: value(ox::forward<type>(value)), error(error) {
|
||||
constexpr Result(type &&value, const Error &error = OxError(0)) noexcept: value(std::move(value)), error(error) {
|
||||
}
|
||||
|
||||
constexpr ~Result() noexcept = default;
|
||||
|
Loading…
Reference in New Issue
Block a user