Boost logo

Boost :

From: Rainer Deyke (root_at_[hidden])
Date: 2002-03-19 11:03:16

----- Original Message -----
From: "Dylan Nicholson" <dylan_nicholson_at_[hidden]>
To: "boost list" <boost_at_[hidden]>
Sent: Monday, March 18, 2002 10:37 PM
Subject: [boost] Remarkably efficient file copy

> If we definitely decide to put in a "copy_file" routine into
> then believe it or not, the following single line of code is
> efficient (at least under HP aCC 3.33, which is what I tested it
> bool copy(const char* src, const char* dest)
> {
> return std::ofstream(dest) << std::ifstream(src).rdbuf();
> }

It's also subtly incorrect. Both streams need to be opened in binary

Rainer Deyke | root_at_[hidden] |

Boost list run by bdawes at, gregod at, cpdaniel at, john at