diff options
| author | Phil Nash | 2017-06-29 11:47:09 +0100 |
|---|---|---|
| committer | Phil Nash | 2017-06-29 11:47:09 +0100 |
| commit | 03afbdfec9ce61cdb93f126d805b78bce9bbbe96 (patch) | |
| tree | e06790dd3b1b5a97a0337fc7fc431af5aabf20f9 /include/internal/catch_stringref.cpp | |
| parent | f9ce8fd03b4fc99121262e5b55465332b8c1957a (diff) | |
| download | catch3-03afbdfec9ce61cdb93f126d805b78bce9bbbe96.tar.gz | |
Made more of StringRef noexcept
Diffstat (limited to 'include/internal/catch_stringref.cpp')
| -rw-r--r-- | include/internal/catch_stringref.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/internal/catch_stringref.cpp b/include/internal/catch_stringref.cpp index d577d3af..147564de 100644 --- a/include/internal/catch_stringref.cpp +++ b/include/internal/catch_stringref.cpp @@ -17,11 +17,11 @@ namespace Catch { StringRef StringRef::s_emptyStringRef = ""; - StringRef::StringRef() + StringRef::StringRef() noexcept : StringRef( s_emptyStringRef ) {} - StringRef::StringRef( StringRef const& other ) + StringRef::StringRef( StringRef const& other ) noexcept : m_start( other.m_start ), m_size( other.m_size ), m_data( other.m_data ) @@ -38,12 +38,12 @@ namespace Catch { other.m_data = nullptr; } - StringRef::StringRef( char const* rawChars ) + StringRef::StringRef( char const* rawChars ) noexcept : m_start( rawChars ), m_size( std::strlen( rawChars ) ) {} - StringRef::StringRef( char const* rawChars, size_type size ) + StringRef::StringRef( char const* rawChars, size_type size ) noexcept : m_start( rawChars ), m_size( size ) { @@ -52,7 +52,7 @@ namespace Catch { size = rawSize; } - StringRef::StringRef( String const& other ) + StringRef::StringRef( String const& other ) noexcept : m_start( other.c_str() ), m_size( other.size() ), m_data( nullptr ) @@ -71,7 +71,7 @@ namespace Catch { m_data->release(); } - auto StringRef::operator = ( StringRef other ) -> StringRef& { + auto StringRef::operator = ( StringRef other ) noexcept -> StringRef& { swap( other ); return *this; } |