If the intent was to use std::copy and stream iterators, I have nothing to add.
If the intent was to write a function to copy a file, this would be easier and also more efficient.
bool copy_file( const char* input_file, const char* output_file )
{ return std::ofstream( output_file ) << std::ifstream(input_file).rdbuf() ; }