mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 19:53:28 +01:00
Updated NonCopyable (to include C++11 version) and use for Session and Section
This commit is contained in:
parent
e606cebac5
commit
12fe67cc82
@ -97,7 +97,7 @@ namespace Catch {
|
|||||||
std::set<TestCase> m_testsAlreadyRun;
|
std::set<TestCase> m_testsAlreadyRun;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Session {
|
class Session : NonCopyable {
|
||||||
static bool alreadyInstantiated;
|
static bool alreadyInstantiated;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -24,8 +24,16 @@
|
|||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
class NonCopyable {
|
class NonCopyable {
|
||||||
NonCopyable( NonCopyable const& );
|
#ifdef CATCH_CPP11_OR_GREATER
|
||||||
void operator = ( NonCopyable const& );
|
NonCopyable( NonCopyable const& ) = delete;
|
||||||
|
NonCopyable( NonCopyable && ) = delete;
|
||||||
|
NonCopyable& operator = ( NonCopyable const& ) = delete;
|
||||||
|
NonCopyable& operator = ( NonCopyable && ) = delete;
|
||||||
|
#else
|
||||||
|
NonCopyable( NonCopyable const& info );
|
||||||
|
NonCopyable& operator = ( NonCopyable const& );
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
NonCopyable() {}
|
NonCopyable() {}
|
||||||
virtual ~NonCopyable();
|
virtual ~NonCopyable();
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
class Section {
|
class Section : NonCopyable {
|
||||||
public:
|
public:
|
||||||
Section( SectionInfo const& info );
|
Section( SectionInfo const& info );
|
||||||
~Section();
|
~Section();
|
||||||
@ -25,15 +25,6 @@ namespace Catch {
|
|||||||
operator bool() const;
|
operator bool() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef CATCH_CPP11_OR_GREATER
|
|
||||||
Section( Section const& ) = delete;
|
|
||||||
Section( Section && ) = delete;
|
|
||||||
Section& operator = ( Section const& ) = delete;
|
|
||||||
Section& operator = ( Section && ) = delete;
|
|
||||||
#else
|
|
||||||
Section( Section const& info );
|
|
||||||
Section& operator = ( Section const& );
|
|
||||||
#endif
|
|
||||||
SectionInfo m_info;
|
SectionInfo m_info;
|
||||||
|
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
|
Loading…
Reference in New Issue
Block a user