| 1879 | { |
| 1880 | template<class T, typename std::enable_if<std::is_trivially_copyable<T>::value, int>::type = 0> |
| 1881 | inline void arrayShiftBackward(T* const src, T* const dst, const std::size_t moveCount, std::size_t) { |
| 1882 | // Compared to the non-trivially-copyable variant below, just delegate to memmove() and assume it can figure |
| 1883 | // out how to copy from front to back more efficiently that we ever could. |
| 1884 | // Same as with memcpy(), apparently memmove() can't be called with null pointers, even if size is zero. I call that bullying. |
| 1885 | if (moveCount != 0) std::memmove(dst, src, moveCount * sizeof(T)); |
| 1886 | } |
| 1887 | |
| 1888 | template<class T, typename std::enable_if<!std::is_trivially_copyable<T>::value, int>::type = 0> |
| 1889 | inline void arrayShiftBackward(T* const src, T* const dst, const std::size_t moveCount, std::size_t destructCount) { |
no outgoing calls
no test coverage detected