array in_range fix

master
Daniel Kolesa 2015-05-18 01:57:44 +01:00
parent 1d4e01ad5e
commit 767226a4ce
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ namespace octa {
bool in_range(size_t idx) noexcept { return idx < N; }
bool in_range(int idx) noexcept { return idx >= 0 && idx < N; }
bool in_range(const T *ptr) noexcept {
return ptr >= &p_buf[0] && ptr < &p_buf[p_len];
return ptr >= &p_buf[0] && ptr < &p_buf[N];
}
T *get() noexcept { return p_buf; }