Why is `std::copy` 5x (!) slower than `memcpy` in my test program?
This is a follow-up to this question where I posted this program: #include <algorithm> #include <cstdlib> #include <cstdio> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <vector> #include <chrono> class Stopwatch { public: typedef std::chrono::high_resolution_clock Clock; //! Constructor starts the stopwatch Stopwatch() : mStart(Clock::now()) { } //! Returns elapsed number of seconds in decimal form. double elapsed() { return 1.0 * (Clock::now() - mStart).count() / Clock::period::den; } Clock::time_point mStart; }; struct test_cast { int operator()(const