mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-17 03:02:24 +01:00
Disable copy constructor of Session
Since only one instance of Catch::Session can ever be used. While trying to call session in my own function, I made a mistake of passing session object by value. It called copy constructor and destructor later, which called Catch::clean(). Disabling copy constructor of session can prevent similar mistakes.
This commit is contained in:
parent
d4e5f18436
commit
25f196098e
@ -100,6 +100,10 @@ namespace Catch {
|
||||
class Session {
|
||||
static bool alreadyInstantiated;
|
||||
|
||||
private:
|
||||
// Prevent copy constructor
|
||||
Session(const Session& other);
|
||||
|
||||
public:
|
||||
|
||||
struct OnUnusedOptions { enum DoWhat { Ignore, Fail }; };
|
||||
|
Loading…
Reference in New Issue
Block a user