| 9 | |
| 10 | template<class T> |
| 11 | inline bool cpp::marshal::View<T>::tryCopyTo(const View<T>& destination) const |
| 12 | { |
| 13 | if (destination.length < length) |
| 14 | { |
| 15 | return false; |
| 16 | } |
| 17 | |
| 18 | if (ptr.ptr + length < destination.ptr.ptr || destination.ptr.ptr + length < ptr.ptr) |
| 19 | std::memcpy(destination.ptr.ptr, ptr.ptr, sizeof(T) * length); |
| 20 | else |
| 21 | std::memmove(destination.ptr.ptr, ptr.ptr, sizeof(T) * length); |
| 22 | |
| 23 | return true; |
| 24 | } |
| 25 | |
| 26 | template<class T> |
| 27 | inline void cpp::marshal::View<T>::copyTo(const View<T>& destination) const |