Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Move all stringref function bodies out of line

Commit
5ebbec7dabf4ed7bef108d6d01cc29b4b096c99b
Author
Martin Hořeňovský ·
Parents
a40add315382

Files · Download .tar.gz

Changes

 include/internal/catch_stringref.cpp | 12 ++++++++++++
 include/internal/catch_stringref.h   | 12 +++---------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/include/internal/catch_stringref.cpp b/include/internal/catch_stringref.cpp
index 7cf75a75..9572c56f 100644
--- a/include/internal/catch_stringref.cpp
+++ b/include/internal/catch_stringref.cpp
@@ -124,6 +124,18 @@ namespace Catch {
     auto StringRef::operator != ( StringRef const& other ) const noexcept -> bool {
         return !operator==( other );
     }
+
+    auto StringRef::operator[](size_type index) const noexcept -> char {
+        return m_start[index];
+    }
+
+    auto StringRef::empty() const noexcept -> bool {
+        return m_size == 0;
+    }
+
+    auto StringRef::size() const noexcept -> size_type {
+        return m_size;
+    }
         
     auto operator + ( StringRef const& lhs, StringRef const& rhs ) -> String {
         StringBuilder buf;
diff --git a/include/internal/catch_stringref.h b/include/internal/catch_stringref.h
index dd223beb..d7f1efbe 100644
--- a/include/internal/catch_stringref.h
+++ b/include/internal/catch_stringref.h
@@ -51,17 +51,11 @@ namespace Catch {
         auto operator == ( StringRef const& other ) const noexcept -> bool;
         auto operator != ( StringRef const& other ) const noexcept -> bool;
         
-        auto operator[] ( size_type index ) const noexcept -> char {
-            return m_start[index];
-        }
+        auto operator[] ( size_type index ) const noexcept -> char;
         
     public: // named queries
-        auto empty() const noexcept -> bool {
-            return m_size == 0;
-        }
-        auto size() const noexcept -> size_type {
-            return m_size;
-        }
+        auto empty() const noexcept -> bool;
+        auto size() const noexcept -> size_type;
         auto c_str() const -> char const*;
         
     public: // substrings and searches