always_inline a few methods
This commit is contained in:
parent
8ba6804480
commit
e9af3a4217
|
@ -44,6 +44,8 @@ public:
|
||||||
|
|
||||||
constexpr T* pointer() const { return m_pointer; }
|
constexpr T* pointer() const { return m_pointer; }
|
||||||
constexpr size_t size() const { return m_size; }
|
constexpr size_t size() const { return m_size; }
|
||||||
|
|
||||||
|
[[gnu::always_inline]]
|
||||||
constexpr T& operator[](size_t n) const { return *(m_pointer + n); }
|
constexpr T& operator[](size_t n) const { return *(m_pointer + n); }
|
||||||
|
|
||||||
constexpr T* begin() const { return m_pointer; }
|
constexpr T* begin() const { return m_pointer; }
|
||||||
|
|
|
@ -18,7 +18,9 @@ struct MirroredArray : public ArrayView<T>
|
||||||
(*this)[i] = 0;
|
(*this)[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[gnu::always_inline]]
|
||||||
T& operator[](int n) { return ArrayView<T>::operator[](n + size); }
|
T& operator[](int n) { return ArrayView<T>::operator[](n + size); }
|
||||||
|
[[gnu::always_inline]]
|
||||||
const T& operator[](int n) const { return ArrayView<T>::operator[](n + size); }
|
const T& operator[](int n) const { return ArrayView<T>::operator[](n + size); }
|
||||||
private:
|
private:
|
||||||
int size;
|
int size;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user