diff options
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/std/cm/bits/string_view.cxx | 36 | ||||
-rw-r--r-- | Utilities/std/cm/string_view | 4 | ||||
-rw-r--r-- | Utilities/std/cmext/iterator | 8 |
3 files changed, 22 insertions, 26 deletions
diff --git a/Utilities/std/cm/bits/string_view.cxx b/Utilities/std/cm/bits/string_view.cxx index 5381fe6..af5ae78 100644 --- a/Utilities/std/cm/bits/string_view.cxx +++ b/Utilities/std/cm/bits/string_view.cxx @@ -82,8 +82,8 @@ int string_view::compare(size_type pos1, size_type count1, const char* s, return substr(pos1, count1).compare(string_view(s, count2)); } -string_view::size_type string_view::find(string_view v, size_type pos) const - noexcept +string_view::size_type string_view::find(string_view v, + size_type pos) const noexcept { for (; pos + v.size_ <= size_; ++pos) { if (std::char_traits<char>::compare(data_ + pos, v.data_, v.size_) == 0) { @@ -109,8 +109,8 @@ string_view::size_type string_view::find(const char* s, size_type pos) const return find(string_view(s), pos); } -string_view::size_type string_view::rfind(string_view v, size_type pos) const - noexcept +string_view::size_type string_view::rfind(string_view v, + size_type pos) const noexcept { if (size_ >= v.size_) { for (pos = std::min(pos, size_ - v.size_) + 1; pos > 0;) { @@ -151,8 +151,8 @@ string_view::size_type string_view::find_first_of(string_view v, return npos; } -string_view::size_type string_view::find_first_of(char c, size_type pos) const - noexcept +string_view::size_type string_view::find_first_of(char c, + size_type pos) const noexcept { return find_first_of(string_view(&c, 1), pos); } @@ -183,8 +183,8 @@ string_view::size_type string_view::find_last_of(string_view v, return npos; } -string_view::size_type string_view::find_last_of(char c, size_type pos) const - noexcept +string_view::size_type string_view::find_last_of(char c, + size_type pos) const noexcept { return find_last_of(string_view(&c, 1), pos); } @@ -201,9 +201,8 @@ string_view::size_type string_view::find_last_of(const char* s, return find_last_of(string_view(s), pos); } -string_view::size_type string_view::find_first_not_of(string_view v, - size_type pos) const - noexcept +string_view::size_type string_view::find_first_not_of( + string_view v, size_type pos) const noexcept { for (; pos < size_; ++pos) { if (!traits_type::find(v.data_, v.size_, data_[pos])) { @@ -213,9 +212,8 @@ string_view::size_type string_view::find_first_not_of(string_view v, return npos; } -string_view::size_type string_view::find_first_not_of(char c, - size_type pos) const - noexcept +string_view::size_type string_view::find_first_not_of( + char c, size_type pos) const noexcept { return find_first_not_of(string_view(&c, 1), pos); } @@ -233,9 +231,8 @@ string_view::size_type string_view::find_first_not_of(const char* s, return find_first_not_of(string_view(s), pos); } -string_view::size_type string_view::find_last_not_of(string_view v, - size_type pos) const - noexcept +string_view::size_type string_view::find_last_not_of( + string_view v, size_type pos) const noexcept { if (size_ > 0) { for (pos = std::min(pos, size_ - 1) + 1; pos > 0;) { @@ -248,9 +245,8 @@ string_view::size_type string_view::find_last_not_of(string_view v, return npos; } -string_view::size_type string_view::find_last_not_of(char c, - size_type pos) const - noexcept +string_view::size_type string_view::find_last_not_of( + char c, size_type pos) const noexcept { return find_last_not_of(string_view(&c, 1), pos); } diff --git a/Utilities/std/cm/string_view b/Utilities/std/cm/string_view index 35cf5d9..320e1e7 100644 --- a/Utilities/std/cm/string_view +++ b/Utilities/std/cm/string_view @@ -157,8 +157,8 @@ public: size_type count) const; size_type find_first_not_of(const char* s, size_type pos = 0) const; - size_type find_last_not_of(string_view v, size_type pos = npos) const - noexcept; + size_type find_last_not_of(string_view v, + size_type pos = npos) const noexcept; size_type find_last_not_of(char c, size_type pos = npos) const noexcept; size_type find_last_not_of(const char* s, size_type pos, size_type count) const; diff --git a/Utilities/std/cmext/iterator b/Utilities/std/cmext/iterator index 83d7890..eba10dd 100644 --- a/Utilities/std/cmext/iterator +++ b/Utilities/std/cmext/iterator @@ -39,10 +39,10 @@ using is_input_range = std::is_pointer<Range>::value || std::is_array<Range>::value>; #else - cm::bool_constant<cm::is_input_iterator<decltype( - std::begin(std::declval<const Range>()))>::value && - cm::is_input_iterator<decltype( - std::end(std::declval<const Range>()))>::value>; + cm::bool_constant<cm::is_input_iterator<decltype(std::begin( + std::declval<const Range>()))>::value && + cm::is_input_iterator<decltype(std::end( + std::declval<const Range>()))>::value>; #endif } // namespace cm |