From fbc0de2528f93c3380a2e98b885c1d875975c2e7 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 18 Oct 2019 21:43:37 -0400 Subject: [PATCH] Added starts/ends_with --- include/boost/fixed_string/fixed_string.hpp | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/include/boost/fixed_string/fixed_string.hpp b/include/boost/fixed_string/fixed_string.hpp index f412bd1..d1e5728 100644 --- a/include/boost/fixed_string/fixed_string.hpp +++ b/include/boost/fixed_string/fixed_string.hpp @@ -1899,6 +1899,48 @@ public: c, pos); } + bool + starts_with( + string_view_type s) const noexcept + { + return string_view_type(*this).starts_with(s); + } + + bool + starts_with( + CharT c) const noexcept + { + return string_view_type(*this).starts_with(c); + } + + bool + starts_with( + const CharT* s) const + { + return string_view_type(*this).starts_with(s); + } + + bool + ends_with( + string_view_type s) const noexcept + { + return string_view_type(*this).ends_with(s); + } + + bool + ends_with( + CharT c) const noexcept + { + return string_view_type(*this).ends_with(c); + } + + bool + ends_with( + const CharT* s) const + { + return string_view_type(*this).ends_with(s); + } + private: fixed_string& assign_char(CharT ch, std::true_type);