1#ifndef GfxTL__FLATCOPYVECTOR_HEADER__
2#define GfxTL__FLATCOPYVECTOR_HEADER__
35 m_begin = (
T*)_mm_malloc(s *
sizeof(
T), 16);
50 m_begin = (
T*)_mm_malloc(s *
sizeof(
T), 16);
53 memcpy(m_begin, v.m_begin, s *
sizeof(
T));
81 m_begin = (
T*)_mm_malloc(s *
sizeof(
T), 16);
84 memcpy(m_begin, v.m_begin, s *
sizeof(
T));
101 if ((
size_t)(m_capacity - m_begin) < s)
103 size_t olds =
size();
104 T* newBegin = (
T*)_mm_malloc(s *
sizeof(
T), 16);
107 memcpy(newBegin, m_begin, olds *
sizeof(
T));
110 m_end = newBegin + olds;
112 m_capacity = m_begin + s;
119 return m_end - m_begin;
125 return m_capacity - m_begin;
136 if ((
size_t)(m_capacity - m_begin) >= s)
141 T* newBegin = (
T*)_mm_malloc(s *
sizeof(
T), 16);
144 memcpy(newBegin, m_begin,
size() *
sizeof(
T));
147 m_end = newBegin + s;
155 size_t oldsize =
size();
159 for (
size_t i = oldsize; i < s; ++i)
171 operator const T*()
const
191 if (m_end >= m_capacity)
193 size_t olds =
size();
199 T* newBegin = (
T*)_mm_malloc(s *
sizeof(
T), 16);
202 memcpy(newBegin, m_begin, olds *
sizeof(
T));
205 m_end = newBegin + olds;
207 m_capacity = m_begin + s;
216 if (m_end >= m_capacity)
218 size_t whereIdx = where - m_begin;
219 size_t olds =
size();
225 T* newBegin = (
T*)_mm_malloc(s *
sizeof(
T), 16);
228 memcpy(newBegin, m_begin, olds *
sizeof(
T));
231 m_end = newBegin + olds;
233 m_capacity = m_begin + s;
234 where = m_begin + whereIdx;
236 memmove(where + 1, where, (m_end - where) *
sizeof(
T));
244 memmove(where, where + 1, (m_end - where - 1) *
sizeof(
T));
284 return std::reverse_iterator<T*>(m_end);
290 return std::reverse_iterator<const T*>(m_end);
296 return std::reverse_iterator<T*>(m_begin);
302 return std::reverse_iterator<const T*>(m_begin);
const_reverse_iterator rend() const
std::reverse_iterator< const T * > const_reverse_iterator
void push_back(const T &nn)
FlatCopyVector(const FlatCopyVector< T > &v)
std::reverse_iterator< T * > reverse_iterator
void insert(T *where, const T &nn)
FlatCopyVector< T > & operator=(const FlatCopyVector< T > &v)
void resize(size_t s, const value_type &v)
reverse_iterator rbegin()
const T & at(size_type i) const
const_reverse_iterator rbegin() const
const T & const_reference