I didn't check. It's just rather bad practice. Did you test what happen if you change all the code to a simple memcpy? memcpy is an intrinsic on most modern compilers and since the function is inlined, it should expand to optimal copy code.