Skip to content

Commit

Permalink
bugfix returning reference to temporary
Browse files Browse the repository at this point in the history
  • Loading branch information
5had3z committed Jun 20, 2024
1 parent b1bb37f commit 4e2df1e
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions include/data_structures/replay_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,12 @@ template<IsSoAType StepDataSoAType> struct ReplayDataTemplateSoA
[[nodiscard]] auto size() const noexcept -> std::size_t { return data.size(); }

/**
* @brief Get constant reference to replay data at step index
* @brief Get replay data at step index
*
* @param index index of replay observations
* @return const StepDataType&
*/
[[nodiscard]] auto operator[](std::size_t index) const noexcept -> const step_type & { return data[index]; }

/**
* @brief Get reference to replay data at step index
*
* @param index index of replay observations
* @return const StepDataType&
* @return StepDataType
*/
[[nodiscard]] auto operator[](std::size_t index) noexcept -> step_type & { return data[index]; }
[[nodiscard]] auto operator[](std::size_t index) const noexcept -> step_type { return data[index]; }

/**
* @brief Get the unique hash ID of the replay
Expand Down

0 comments on commit 4e2df1e

Please sign in to comment.