When can I get better performance using memcpy
or how do I benefit from using it?
For example:
float a[3]; float b[3];
is cod
Use std::copy()
. As the header file for g++
notes:
This inline function will boil down to a call to @c memmove whenever possible.
Probably, Visual Studio's is not much different. Go with the normal way, and optimize once you're aware of a bottle neck. In the case of a simple copy, the compiler is probably already optimizing for you.