| 63 | /// @returns a new vector_ref which is a shifted view of the original data (not going beyond it). |
| 64 | vector_ref<_T> cropped(size_t _begin) const { if (m_data && _begin <= m_count) return vector_ref<_T>(m_data + _begin, m_count - _begin); else return vector_ref<_T>(); } |
| 65 | void retarget(_T* _d, size_t _s) { m_data = _d; m_count = _s; } |
| 66 | void retarget(std::vector<_T> const& _t) { m_data = _t.data(); m_count = _t.size(); } |
| 67 | template <class T> bool overlapsWith(vector_ref<T> _t) const { void const* f1 = data(); void const* t1 = data() + size(); void const* f2 = _t.data(); void const* t2 = _t.data() + _t.size(); return f1 < t2 && t1 > f2; } |
| 68 | /// Copies the contents of this vector_ref to the contents of @a _t, up to the max size of @a _t. |