diff --git a/Src/IACore/imp/cpp/IACore.cpp b/Src/IACore/imp/cpp/IACore.cpp index 5311c29..0c8d532 100644 --- a/Src/IACore/imp/cpp/IACore.cpp +++ b/Src/IACore/imp/cpp/IACore.cpp @@ -43,7 +43,7 @@ namespace IACore FLOAT64 GetSecondsCount() { - return (HighResClock::now() - g_startTime).count(); + return std::chrono::duration_cast(HighResClock::now() - g_startTime) .count(); } UINT32 GetRandom(IN UINT32 seed) diff --git a/Src/IACore/imp/cpp/JSON.cpp b/Src/IACore/imp/cpp/JSON.cpp index 0f63f06..18bd604 100644 --- a/Src/IACore/imp/cpp/JSON.cpp +++ b/Src/IACore/imp/cpp/JSON.cpp @@ -26,14 +26,14 @@ namespace IACore return parseResult; } - Expected JSON::ParseReadOnly(IN CONST String &json) + Expected, String> JSON::ParseReadOnly(IN CONST String &json) { simdjson::error_code error{}; simdjson::dom::parser parser; simdjson::dom::object object; if ((error = parser.parse(json).get(object))) return MakeUnexpected(std::format("Failed to parse JSON : {}", simdjson::error_message(error))); - return object; + return std::make_pair(IA_MOVE(parser), IA_MOVE(object)); } String JSON::Encode(IN nlohmann::json data) diff --git a/Src/IACore/inc/IACore/JSON.hpp b/Src/IACore/inc/IACore/JSON.hpp index e6b779b..bf4be73 100644 --- a/Src/IACore/inc/IACore/JSON.hpp +++ b/Src/IACore/inc/IACore/JSON.hpp @@ -31,7 +31,7 @@ namespace IACore public: STATIC Expected Parse(IN CONST String &json); - STATIC Expected ParseReadOnly(IN CONST String &json); + STATIC Expected, String> ParseReadOnly(IN CONST String &json); template STATIC Expected<_object_type, String> ParseToStruct(IN CONST String &json); STATIC String Encode(IN nlohmann::json data);