mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-15 01:45:39 +02:00
Section no longer relies on copy-elision for correctness
- should address #293 - *may* address #271
This commit is contained in:
@@ -18,22 +18,22 @@ namespace Catch {
|
||||
|
||||
class Section {
|
||||
public:
|
||||
Section( SourceLineInfo const& lineInfo,
|
||||
std::string const& name,
|
||||
std::string const& description = "" );
|
||||
Section( SectionInfo const& info );
|
||||
~Section();
|
||||
# ifdef CATCH_CPP11_OR_GREATER
|
||||
Section( Section const& ) = default;
|
||||
Section( Section && ) = default;
|
||||
Section& operator = ( Section const& ) = default;
|
||||
Section& operator = ( Section && ) = default;
|
||||
# endif
|
||||
|
||||
// This indicates whether the section should be executed or not
|
||||
operator bool();
|
||||
operator bool() const;
|
||||
|
||||
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;
|
||||
|
||||
std::string m_name;
|
||||
@@ -46,10 +46,10 @@ namespace Catch {
|
||||
|
||||
#ifdef CATCH_CONFIG_VARIADIC_MACROS
|
||||
#define INTERNAL_CATCH_SECTION( ... ) \
|
||||
if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) )
|
||||
if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) )
|
||||
#else
|
||||
#define INTERNAL_CATCH_SECTION( name, desc ) \
|
||||
if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, name, desc ) )
|
||||
if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, name, desc ) )
|
||||
#endif
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
|
||||
|
Reference in New Issue
Block a user