Added starts/ends_with

This commit is contained in:
Krystian Stasiowski
2019-10-18 21:43:37 -04:00
committed by GitHub
parent b2e2215783
commit fbc0de2528

View File

@ -1899,6 +1899,48 @@ public:
c, pos); 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: private:
fixed_string& fixed_string&
assign_char(CharT ch, std::true_type); assign_char(CharT ch, std::true_type);