Skip to content

Commit

Permalink
fixed optional access operators (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
fermentedfly committed Jul 10, 2023
1 parent abcfe82 commit 8c47217
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/etl/optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ namespace etl
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
#endif

return &storage;
return &storage.u.value;
}

//***************************************************************************
Expand All @@ -812,7 +812,7 @@ namespace etl
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
#endif

return &storage;
return &storage.u.value;
}

//***************************************************************************
Expand All @@ -824,7 +824,7 @@ namespace etl
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
#endif

return storage;
return storage.u.value;
}

//***************************************************************************
Expand All @@ -836,7 +836,7 @@ namespace etl
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
#endif

return storage;
return storage.u.value;
}

#if ETL_USING_CPP11
Expand All @@ -849,7 +849,7 @@ namespace etl
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
#endif

return etl::move(storage);
return etl::move(storage.u.value);
}

//***************************************************************************
Expand All @@ -861,7 +861,7 @@ namespace etl
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
#endif

return etl::move(storage);
return etl::move(storage.u.value);
}
#endif

Expand Down

0 comments on commit 8c47217

Please sign in to comment.