Skip to content

Commit

Permalink
update C++ headers
Browse files Browse the repository at this point in the history
  • Loading branch information
9il committed Nov 23, 2019
1 parent 04e52a6 commit ea68ae2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/mir/ndslice.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,16 @@ struct mir_slice<Iterator, 1, mir_slice_kind::contiguous>
return _iterator[index];
}

auto&& backward(mir_size_t index)
{
return at(size() - 1 - index);
}

auto&& backward(mir_size_t index) const
{
return at(size() - 1 - index);
}

auto&& operator[](mir_size_t index)
{
return at(index);
Expand Down
5 changes: 5 additions & 0 deletions include/mir/series.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ struct mir_series
return {_index[index], _data[index]};
}

Observation backward(mir_size_t index) const noexcept
{
return {_index[size() - 1 - index], _data[size() - 1 - index]};
}

Observation operator[](mir_size_t index) const noexcept
{
return {_index[index], _data[index]};
Expand Down

0 comments on commit ea68ae2

Please sign in to comment.