forked from weaselab/conflict-set
Merge pull request 'Disallow copying ConflictSet in C++98/C++03' (#51) from weaselbot/conflict-set:weaselbot/issue-48 into main
Reviewed-on: weaselab/conflict-set#51
This commit is contained in:
@@ -132,6 +132,13 @@ struct __attribute__((__visibility__("default"))) ConflictSet {
|
||||
|
||||
private:
|
||||
Impl *impl;
|
||||
#if __cplusplus <= 199711L
|
||||
/* Declared private and left undefined to prevent copying in C++98/C++03.
|
||||
The compiler would otherwise implicitly generate public copy operations,
|
||||
which share the opaque Impl* and cause a double-free. */
|
||||
ConflictSet(const ConflictSet &);
|
||||
ConflictSet &operator=(const ConflictSet &);
|
||||
#endif
|
||||
};
|
||||
} /* namespace weaselab */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user