MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / arrayShiftBackward

Function arrayShiftBackward

Sources/Shared/Containers/GrowableArray.h:1881–1886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers 2

arrayRemoveFunction · 0.85
arrayRemoveUnorderedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected