From 841a7436c13860fb4f00402c811100c534f9639a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 20 Apr 2021 22:10:14 -0500 Subject: [PATCH] [ox/oc] Replace std::unique_ptr usage with ox::UniquePtr --- deps/ox/src/ox/oc/read.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/deps/ox/src/ox/oc/read.hpp b/deps/ox/src/ox/oc/read.hpp index cff9f117..0c5c9bee 100644 --- a/deps/ox/src/ox/oc/read.hpp +++ b/deps/ox/src/ox/oc/read.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -78,7 +79,8 @@ class OrganicClawReader { /** * Reads an string length from the current location in the buffer. */ - [[nodiscard]] std::size_t stringLength(const char *name); + [[nodiscard]] + std::size_t stringLength(const char *name); template constexpr void setTypeInfo(const char* = T::TypeName, int = T::Fields) { @@ -87,7 +89,8 @@ class OrganicClawReader { /** * Returns a OrganicClawReader to parse a child object. */ - [[nodiscard]] OrganicClawReader child(const char *key, int unionIdx = -1); + [[nodiscard]] + OrganicClawReader child(const char *key, int unionIdx = -1); // compatibility stub constexpr void nextField() noexcept {} @@ -196,8 +199,8 @@ Error readOC(const char *json, std::size_t jsonSize, T *val) noexcept { } template -Result> readOC(const char *json) { - auto val = std::make_unique(); +Result> readOC(const char *json) { + auto val = ox::make_unique(); oxReturnError(readOC(json, ox_strlen(json), val.get())); return val; }