Move subsampling in C++