| 364 | |
| 365 | template <class T> |
| 366 | void fast_vector<T>::bulk_push_back(std::vector<T>& source, int startIndex, int count) |
| 367 | { |
| 368 | if (m_size + count >= m_capacity) |
| 369 | { |
| 370 | reserve(m_capacity * fast_vector::grow_factor + 1); |
| 371 | } |
| 372 | |
| 373 | if constexpr (std::is_trivial_v<T>) |
| 374 | { |
| 375 | T* sourceData = source.data(); |
| 376 | memcpy(m_data + m_size, sourceData + startIndex, sizeof(T) * count); |
| 377 | m_size += count; |
| 378 | } |
| 379 | else |
| 380 | { |
| 381 | for (int i = 0; i < count; i++) |
| 382 | { |
| 383 | new (m_data + m_size) T(source[i]); |
| 384 | m_size++; |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | template <class T> |
| 390 | void fast_vector<T>::bulk_push_back(T* source, int startIndex, int count) |
no test coverage detected