From 16c30d12fbac8761122cdc4f318a30c3d07c3a03 Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Mon, 26 Jun 2023 11:37:56 -0700 Subject: [PATCH] [glacier] Update ErrorOr to work with Move. --- lib/glacier/status/error_or.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/glacier/status/error_or.h b/lib/glacier/status/error_or.h index 9150dcb..3658977 100644 --- a/lib/glacier/status/error_or.h +++ b/lib/glacier/status/error_or.h @@ -1,5 +1,6 @@ #pragma once +#include #include namespace glcr { @@ -15,7 +16,7 @@ class ErrorOr { ErrorOr(ErrorCode code) : error_(code), ok_(false) {} ErrorOr(const T& obj) : obj_(obj), ok_(true) {} - ErrorOr(T&& obj) : obj_(obj), ok_(true) {} + ErrorOr(T&& obj) : obj_(glcr::Move(obj)), ok_(true) {} bool ok() { return ok_; } operator bool() { return ok_; } @@ -41,6 +42,6 @@ class ErrorOr { if (!AOR_VAR(__LINE__).ok()) { \ return AOR_VAR(__LINE__).error(); \ } \ - lhs = AOR_VAR(__LINE__).value(); + lhs = glcr::Move(AOR_VAR(__LINE__).value()); } // namespace glcr