Skip to content

Commit ea68ae2

Browse files
committed
update C++ headers
1 parent 04e52a6 commit ea68ae2

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

include/mir/ndslice.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,16 @@ struct mir_slice<Iterator, 1, mir_slice_kind::contiguous>
253253
return _iterator[index];
254254
}
255255

256+
auto&& backward(mir_size_t index)
257+
{
258+
return at(size() - 1 - index);
259+
}
260+
261+
auto&& backward(mir_size_t index) const
262+
{
263+
return at(size() - 1 - index);
264+
}
265+
256266
auto&& operator[](mir_size_t index)
257267
{
258268
return at(index);

include/mir/series.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ struct mir_series
7171
return {_index[index], _data[index]};
7272
}
7373

74+
Observation backward(mir_size_t index) const noexcept
75+
{
76+
return {_index[size() - 1 - index], _data[size() - 1 - index]};
77+
}
78+
7479
Observation operator[](mir_size_t index) const noexcept
7580
{
7681
return {_index[index], _data[index]};

0 commit comments

Comments
 (0)