From 5ebbec7dabf4ed7bef108d6d01cc29b4b096c99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 27 Jul 2017 10:46:18 +0200 Subject: [PATCH] Move all stringref function bodies out of line --- 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