Skip to content

Commit

Permalink
C4Task::Result: Fix support for move-only types
Browse files Browse the repository at this point in the history
  • Loading branch information
Fulgen301 committed Jul 23, 2023
1 parent d5d5a93 commit 2576076
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/C4Coroutine.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ template<typename U>
struct ValueWrapper
{
[[no_unique_address]] U Value;
U GetValue() const { return static_cast<U>(Value); }
U &&GetValue() { return static_cast<U &&>(Value); }
};

template<>
Expand Down Expand Up @@ -91,7 +91,7 @@ template<typename T, bool IsNoExcept = false>
class ResultBase
{
protected:
decltype(auto) GetValue() const
decltype(auto) GetValue()
{
return result.Wrapper.GetValue();
}
Expand Down Expand Up @@ -203,7 +203,7 @@ class Result : protected ResultBase<T, IsNoExcept>
Result &operator=(const Result &) = delete;

public:
decltype(auto) GetResult() const
decltype(auto) GetResult()
{
switch (resultState)
{
Expand Down

0 comments on commit 2576076

Please sign in to comment.