mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-27 23:34:20 +00:00
autofile: Disallow by-value copies of CAutoFile
One might assume that CAutoFile would be ref-counted so that a copied object would delay closing the underlying file until all copies have gone out of scope. Since that's not the case with CAutoFile, explicitly disable copying.
This commit is contained in:
parent
eee030f6bc
commit
6eb67b0ed2
@ -1154,7 +1154,7 @@ public:
|
||||
|
||||
|
||||
|
||||
/** RAII wrapper for FILE*.
|
||||
/** Non-refcounted RAII wrapper for FILE*.
|
||||
*
|
||||
* Will automatically close the file when it goes out of scope if not null.
|
||||
* If you're returning the file pointer, return file.release().
|
||||
@ -1162,6 +1162,10 @@ public:
|
||||
*/
|
||||
class CAutoFile
|
||||
{
|
||||
private:
|
||||
// Disallow copies
|
||||
CAutoFile(const CAutoFile&);
|
||||
CAutoFile& operator=(const CAutoFile&);
|
||||
protected:
|
||||
FILE* file;
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user