The compiler generated copy constructor and assignment operator are wrong.
This could easily be fixed by implementing them manually, but a) they are
not needed, and b) the semantics would be unclear (should the copy point
to a new temp file or not?), so it is better to forbid them.
* of this class must stay alive as long as the file is needed.
*/
class TempFile {
+ /// noncopyable
+ TempFile(TempFile const &);
+ /// nonassignable
+ TempFile & operator=(TempFile const &);
public:
/**
*Create a temporary file with the given mask.