mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-23 04:55:40 +02:00
performance improvement - isTrue, isFalseTest, SourceLineInfo ctor
inlined isTrue, isFalseTest and SourceLineInfo ctor. Further work on #1086. Brings test from 0m25.584s to 0m20.635s
This commit is contained in:
@@ -43,7 +43,8 @@ namespace Catch {
|
||||
struct SourceLineInfo {
|
||||
|
||||
SourceLineInfo() = delete;
|
||||
SourceLineInfo( char const* _file, std::size_t _line ) noexcept;
|
||||
SourceLineInfo( char const* _file, std::size_t _line ) noexcept
|
||||
: file( _file ), line( _line ) {}
|
||||
|
||||
SourceLineInfo( SourceLineInfo const& other ) = default;
|
||||
SourceLineInfo( SourceLineInfo && ) = default;
|
||||
@@ -61,7 +62,7 @@ namespace Catch {
|
||||
std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info );
|
||||
|
||||
// This is just here to avoid compiler warnings with macro constants and boolean literals
|
||||
bool isTrue( bool value );
|
||||
inline bool isTrue( bool value ) { return value; }
|
||||
bool alwaysTrue();
|
||||
bool alwaysFalse();
|
||||
|
||||
@@ -82,4 +83,3 @@ namespace Catch {
|
||||
::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
|
||||
|
||||
|
Reference in New Issue
Block a user