Don't double delete by making TempFile noncopyable

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.
This commit is contained in:
Georg Baum 2014-06-09 12:59:47 +02:00
parent bf782ee02a
commit ae15b59734

View File

@ -26,6 +26,10 @@ class FileName;
* 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.