| 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. |
| 69 | void copyTo(vector_ref<typename std::remove_const<_T>::type> _t) const { if (overlapsWith(_t)) memmove(_t.data(), m_data, std::min(_t.size(), m_count) * sizeof(_T)); else memcpy(_t.data(), m_data, std::min(_t.size(), m_count) * sizeof(_T)); } |
| 70 | /// Copies the contents of this vector_ref to the contents of @a _t, and zeros further trailing elements in @a _t. |