HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_BlockRelocator.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_BlockRelocator.h (UT Library, C++)
7  *
8  * COMMENTS: UT_Array uses this to relocate array elements.
9  */
10 
11 #pragma once
12 
13 #ifndef __UT_RELOCATOR_H_INCLUDED__
14 #define __UT_RELOCATOR_H_INCLUDED__
15 
16 #include <SYS/SYS_TypeTraits.h>
17 
18 #include <string.h>
19 
20 // Invoke memcpy and memmove without casting the pointer arguments to void*
21 #undef UT_TYPED_INVOKE_RAW_RELOCATION
22 
23 template <typename T>
25 {
26  void operator()(T *dst, const T *src, exint n) const noexcept
27  {
28 #ifdef UT_TYPED_INVOKE_RAW_RELOCATION
29  ::memcpy(dst, src, n * sizeof(T)); // NOLINT
30 #else
31  ::memcpy((void*)dst, (const void*)src, n * sizeof(T)); // NOLINT
32 #endif
33  }
34 };
35 
36 template <typename T>
38 {
39  void operator()(T *dst, const T *src, exint n) const noexcept
40  {
41 #ifdef UT_TYPED_INVOKE_RAW_RELOCATION
42  ::memmove(dst, src, n * sizeof(T)); // NOLINT
43 #else
44  ::memmove((void*)dst, (const void*)src, n * sizeof(T)); // NOLINT
45 #endif
46  }
47 };
48 
49 #endif
50 
void operator()(T *dst, const T *src, exint n) const noexcept
void operator()(T *dst, const T *src, exint n) const noexcept
int64 exint
Definition: SYS_Types.h:125
GLdouble n
Definition: glcorearb.h:2008
GLenum GLenum dst
Definition: glcorearb.h:1793
GLenum src
Definition: glcorearb.h:1793