My Project
basic_string_view.hpp
Go to the documentation of this file.
1 
28 #ifndef BSL_BASIC_STRING_VIEW_HPP
29 #define BSL_BASIC_STRING_VIEW_HPP
30 
31 #include "char_traits.hpp"
32 #include "contiguous_iterator.hpp"
33 #include "cstdint.hpp"
34 #include "debug.hpp"
35 #include "min_of.hpp"
36 #include "npos.hpp"
37 #include "numeric_limits.hpp"
38 #include "reverse_iterator.hpp"
39 
40 // TODO:
41 // - Need to implement the find functions. These need the safe_int class as
42 // there is a lot of math that could result in overflow that needs to be
43 // accounted for.
44 //
45 
46 namespace bsl
47 {
59  template<typename CharT, typename Traits = char_traits<CharT>>
60  class basic_string_view final // NOLINT
61  {
62  public:
64  using value_type = CharT const;
70  using reference_type = CharT const &;
72  using const_reference_type = CharT const &;
74  using pointer_type = CharT const *;
76  using const_pointer_type = CharT const *;
85 
103  constexpr basic_string_view() noexcept = default;
104 
121  constexpr basic_string_view(pointer_type const s) noexcept // PRQA S 2180 // NOLINT
122  : m_ptr{s}, m_count{Traits::length(s)}
123  {
124  if ((nullptr == m_ptr) || (0U == m_count)) {
125  *this = basic_string_view{};
126  }
127  }
128 
140  constexpr basic_string_view &
141  operator=(pointer_type const s) &noexcept
142  {
143  *this = basic_string_view{s};
144  return *this;
145  }
146 
165  [[nodiscard]] constexpr pointer_type
166  at_if(size_type const index) noexcept
167  {
168  if ((nullptr == m_ptr) || (index >= m_count)) {
169  return nullptr;
170  }
171 
172  return &m_ptr[index]; // PRQA S 4024 // NOLINT
173  }
174 
187  [[nodiscard]] constexpr const_pointer_type
188  at_if(size_type const index) const noexcept
189  {
190  if ((nullptr == m_ptr) || (index >= m_count)) {
191  return nullptr;
192  }
193 
194  return &m_ptr[index]; // NOLINT
195  }
196 
208  [[nodiscard]] constexpr pointer_type
209  front_if() noexcept
210  {
211  return this->at_if(0U);
212  }
213 
225  [[nodiscard]] constexpr const_pointer_type
226  front_if() const noexcept
227  {
228  return this->at_if(0U);
229  }
230 
242  [[nodiscard]] constexpr pointer_type
243  back_if() noexcept
244  {
245  return this->at_if((m_count > 0U) ? (m_count - 1U) : 0U);
246  }
247 
259  [[nodiscard]] constexpr const_pointer_type
260  back_if() const noexcept
261  {
262  return this->at_if((m_count > 0U) ? (m_count - 1U) : 0U);
263  }
264 
276  [[nodiscard]] constexpr pointer_type
277  data() noexcept
278  {
279  return m_ptr;
280  }
281 
293  [[nodiscard]] constexpr const_pointer_type
294  data() const noexcept
295  {
296  return m_ptr;
297  }
298 
306  [[nodiscard]] constexpr iterator_type
307  begin() noexcept
308  {
309  return iterator_type{m_ptr, m_count, 0U};
310  }
311 
319  [[nodiscard]] constexpr const_iterator_type
320  begin() const noexcept
321  {
322  return const_iterator_type{m_ptr, m_count, 0U};
323  }
324 
332  [[nodiscard]] constexpr const_iterator_type
333  cbegin() const noexcept
334  {
335  return const_iterator_type{m_ptr, m_count, 0U};
336  }
337 
346  [[nodiscard]] constexpr iterator_type
347  iter(size_type const i) noexcept
348  {
349  return iterator_type{m_ptr, m_count, i};
350  }
351 
360  [[nodiscard]] constexpr const_iterator_type
361  iter(size_type const i) const noexcept
362  {
363  return const_iterator_type{m_ptr, m_count, i};
364  }
365 
374  [[nodiscard]] constexpr const_iterator_type
375  citer(size_type const i) const noexcept
376  {
377  return const_iterator_type{m_ptr, m_count, i};
378  }
379 
391  [[nodiscard]] constexpr iterator_type
392  end() noexcept
393  {
394  return iterator_type{m_ptr, m_count, m_count};
395  }
396 
408  [[nodiscard]] constexpr const_iterator_type
409  end() const noexcept
410  {
411  return const_iterator_type{m_ptr, m_count, m_count};
412  }
413 
425  [[nodiscard]] constexpr const_iterator_type
426  cend() const noexcept
427  {
428  return const_iterator_type{m_ptr, m_count, m_count};
429  }
430 
444  [[nodiscard]] constexpr reverse_iterator_type
445  rbegin() noexcept
446  {
447  return reverse_iterator_type{this->end()};
448  }
449 
463  [[nodiscard]] constexpr const_reverse_iterator_type
464  rbegin() const noexcept
465  {
466  return const_reverse_iterator_type{this->end()};
467  }
468 
482  [[nodiscard]] constexpr const_reverse_iterator_type
483  crbegin() const noexcept
484  {
485  return const_reverse_iterator_type{this->cend()};
486  }
487 
502  [[nodiscard]] constexpr reverse_iterator_type
503  riter(size_type const i) noexcept
504  {
505  size_type const ai{(i >= m_count) ? m_count : (i + 1U)};
506  return reverse_iterator_type{this->iter(ai)};
507  }
508 
523  [[nodiscard]] constexpr const_reverse_iterator_type
524  riter(size_type const i) const noexcept
525  {
526  size_type const ai{(i >= m_count) ? m_count : (i + 1U)};
527  return const_reverse_iterator_type{this->iter(ai)};
528  }
529 
544  [[nodiscard]] constexpr const_reverse_iterator_type
545  criter(size_type const i) const noexcept
546  {
547  size_type const ai{(i >= m_count) ? m_count : (i + 1U)};
548  return const_reverse_iterator_type{this->citer(ai)};
549  }
550 
564  [[nodiscard]] constexpr reverse_iterator_type
565  rend() noexcept
566  {
567  return reverse_iterator_type{this->begin()};
568  }
569 
583  [[nodiscard]] constexpr const_reverse_iterator_type
584  rend() const noexcept
585  {
586  return const_reverse_iterator_type{this->begin()};
587  }
588 
602  [[nodiscard]] constexpr const_reverse_iterator_type
603  crend() const noexcept
604  {
605  return const_reverse_iterator_type{this->cbegin()};
606  }
607 
615  [[nodiscard]] constexpr bool
616  empty() const noexcept
617  {
618  return 0U == m_count;
619  }
620 
632  [[nodiscard]] constexpr size_type
633  size() const noexcept
634  {
635  return m_count;
636  }
637 
649  [[nodiscard]] constexpr size_type
650  length() const noexcept
651  {
652  return this->size();
653  }
654 
662  [[nodiscard]] static constexpr size_type
663  max_size() noexcept
664  {
665  return numeric_limits<size_type>::max() / sizeof(CharT);
666  }
667 
675  [[nodiscard]] constexpr size_type
676  size_bytes() const noexcept
677  {
678  return m_count * sizeof(CharT);
679  }
680 
692  [[maybe_unused]] constexpr basic_string_view &
693  remove_prefix(size_type const n) noexcept
694  {
695  if (n >= this->size()) {
696  *this = basic_string_view{};
697  }
698 
699  *this = basic_string_view{this->at_if(n), this->size() - n};
700  return *this;
701  }
702 
714  [[maybe_unused]] constexpr basic_string_view &
715  remove_suffix(size_type const n) noexcept
716  {
717  if (n >= this->size()) {
718  *this = basic_string_view{};
719  }
720 
721  *this = basic_string_view{this->at_if(0U), this->size() - n};
722  return *this;
723  }
724 
744  [[nodiscard]] constexpr basic_string_view
745  substr(size_type const pos = 0U, size_type const count = npos) const noexcept
746  {
747  if (pos >= this->size()) {
748  return basic_string_view{};
749  }
750 
751  return basic_string_view{this->at_if(pos), min_of(count, this->size() - pos)};
752  }
753 
762  [[nodiscard]] constexpr bsl::int32
763  compare(basic_string_view const &str) const noexcept
764  {
765  return Traits::compare(this->data(), str.data(), min_of(this->size(), str.size()));
766  }
767 
778  [[nodiscard]] constexpr bsl::int32
779  compare( // --
780  size_type const pos, // --
781  size_type const count, // --
782  basic_string_view const &str) const noexcept
783  {
784  return this->substr(pos, count).compare(str);
785  }
786 
799  [[nodiscard]] constexpr bsl::int32
800  compare( // --
801  size_type pos1, // --
802  size_type count1, // --
803  basic_string_view const &str, // --
804  size_type pos2, // --
805  size_type count2) const noexcept
806  {
807  return this->substr(pos1, count1).compare(str.substr(pos2, count2));
808  }
809 
818  [[nodiscard]] constexpr bsl::int32
819  compare(pointer_type const str) const noexcept
820  {
821  return this->compare(basic_string_view{str});
822  }
823 
834  [[nodiscard]] constexpr bsl::int32
835  compare(size_type pos, size_type count, pointer_type const str) const noexcept
836  {
837  return this->substr(pos, count).compare(basic_string_view{str});
838  }
839 
857  [[nodiscard]] constexpr bsl::int32
858  compare( // --
859  size_type pos, // --
860  size_type count1, // --
861  pointer_type const str, // --
862  size_type count2) const noexcept
863  {
864  return this->compare(pos, count1, basic_string_view{str}, 0, count2);
865  }
866 
876  [[nodiscard]] constexpr bool
877  starts_with(basic_string_view const &str) const noexcept
878  {
879  if (this->size() < str.size()) {
880  return false;
881  }
882 
883  return this->substr(0U, str.size()) == str;
884  }
885 
895  [[nodiscard]] constexpr bool
896  starts_with(value_type const c) const noexcept
897  {
898  if (auto *const ptr = this->front_if()) {
899  return Traits::eq(*ptr, c);
900  }
901 
902  return false;
903  }
904 
914  [[nodiscard]] constexpr bool
915  starts_with(pointer_type const str) const noexcept
916  {
917  return this->starts_with(basic_string_view{str});
918  }
919 
929  [[nodiscard]] constexpr bool
930  ends_with(basic_string_view const &str) const noexcept
931  {
932  if (this->size() < str.size()) {
933  return false;
934  }
935 
936  return this->compare(this->size() - str.size(), npos, str) == 0;
937  }
938 
948  [[nodiscard]] constexpr bool
949  ends_with(value_type const c) const noexcept
950  {
951  if (auto *const ptr = this->back_if()) {
952  return Traits::eq(*ptr, c);
953  }
954 
955  return false;
956  }
957 
967  [[nodiscard]] constexpr bool
968  ends_with(pointer_type const str) const noexcept
969  {
970  return this->ends_with(basic_string_view{str});
971  }
972 
973  private:
984  constexpr basic_string_view(pointer_type const s, size_type const count) noexcept
985  : m_ptr{s}, m_count{count}
986  {
987  if ((nullptr == m_ptr) || (0U == m_count)) {
988  *this = basic_string_view{};
989  }
990  }
991 
993  pointer_type m_ptr;
995  size_type m_count;
996  };
997 
1016  template<typename CharT, typename Traits>
1017  constexpr bool
1020  bsl::basic_string_view<CharT, Traits> const &rhs) noexcept
1021  {
1022  if (lhs.size() != rhs.size()) {
1023  return false;
1024  }
1025 
1026  return lhs.compare(rhs) == 0;
1027  }
1028 
1047  template<typename CharT, typename Traits>
1048  constexpr bool
1049  operator==(bsl::basic_string_view<CharT, Traits> const &lhs, CharT const *const rhs) noexcept
1050  {
1051  return lhs == bsl::basic_string_view<CharT, Traits>{rhs};
1052  }
1053 
1072  template<typename CharT, typename Traits>
1073  constexpr bool
1074  operator==(CharT const *const lhs, bsl::basic_string_view<CharT, Traits> const &rhs) noexcept
1075  {
1076  return bsl::basic_string_view<CharT, Traits>{lhs} == rhs;
1077  }
1078 
1097  template<typename CharT, typename Traits>
1098  constexpr bool
1101  bsl::basic_string_view<CharT, Traits> const &rhs) noexcept
1102  {
1103  return !(lhs == rhs);
1104  }
1105 
1124  template<typename CharT, typename Traits>
1125  constexpr bool
1126  operator!=(bsl::basic_string_view<CharT, Traits> const &lhs, CharT const *const rhs) noexcept
1127  {
1128  return !(lhs == rhs);
1129  }
1130 
1149  template<typename CharT, typename Traits>
1150  constexpr bool
1151  operator!=(CharT const *const lhs, bsl::basic_string_view<CharT, Traits> const &rhs) noexcept
1152  {
1153  return !(lhs == rhs);
1154  }
1155 
1169  template<typename OUT, typename CharT>
1170  constexpr void
1171  fmt_impl(OUT &&o, fmt_options const &ops, basic_string_view<CharT> const &str) noexcept
1172  {
1173  details::fmt_impl_align_pre(o, ops, str.length(), true);
1174  o.write(str.data());
1175  details::fmt_impl_align_suf(o, ops, str.length(), true);
1176  }
1177 
1189  template<typename T, typename CharT>
1190  [[maybe_unused]] constexpr out<T>
1191  operator<<(out<T> const o, basic_string_view<CharT> const &str) noexcept
1192  {
1193  if constexpr (o.empty()) {
1194  return o;
1195  }
1196 
1197  o.write(str.data());
1198  return o;
1199  }
1200 }
1201 
1202 #endif
constexpr bool empty() const noexcept
Returns size() == 0.
Definition: basic_string_view.hpp:616
constexpr reverse_iterator_type rend() noexcept
Returns a reverse iterator first element of the view. When accessing the iterator,...
Definition: basic_string_view.hpp:565
constexpr bool starts_with(value_type const c) const noexcept
Checks if the string begins with the given prefix.
Definition: basic_string_view.hpp:896
constexpr pointer_type back_if() noexcept
Returns a pointer to the instance of T stored at index "size() - 1". If the index is out of bounds,...
Definition: basic_string_view.hpp:243
constexpr bsl::uintmax npos
defines npos
Definition: npos.hpp:37
constexpr const_pointer_type front_if() const noexcept
Returns a pointer to the instance of T stored at index "0". If the index is out of bounds,...
Definition: basic_string_view.hpp:226
constexpr pointer_type data() noexcept
Returns a pointer to the string being viewed. If this is a default constructed view,...
Definition: basic_string_view.hpp:277
constexpr bool operator!=(bsl::basic_string_view< CharT, Traits > const &lhs, CharT const *const rhs) noexcept
Returns true if two strings are not the same length (which is different from compare() which uses the...
Definition: basic_string_view.hpp:1126
constexpr bsl::int32 compare(size_type const pos, size_type const count, basic_string_view const &str) const noexcept
Same as substr(pos, count).compare(v)
Definition: basic_string_view.hpp:779
constexpr basic_string_view & remove_prefix(size_type const n) noexcept
Moves the start of the view forward by n characters. If n >= size(), the bsl::basic_string_view is re...
Definition: basic_string_view.hpp:693
reverse_iterator< iterator_type > reverse_iterator_type
alias for: reverse_iterator<iterator>
Definition: basic_string_view.hpp:82
constexpr const_reverse_iterator_type rend() const noexcept
Returns a reverse iterator first element of the view. When accessing the iterator,...
Definition: basic_string_view.hpp:584
constexpr iterator_type iter(size_type const i) noexcept
Returns an iterator to the element "i" in the view.
Definition: basic_string_view.hpp:347
constexpr const_reverse_iterator_type rbegin() const noexcept
Returns a reverse iterator to one past the last element of the view. When accessing the iterator,...
Definition: basic_string_view.hpp:464
A bsl::basic_string_view is a non-owning, encapsulation of a string, providing helper functions for w...
Definition: basic_string_view.hpp:60
constexpr bool operator!=(bsl::basic_string_view< CharT, Traits > const &lhs, bsl::basic_string_view< CharT, Traits > const &rhs) noexcept
Returns true if two strings are not the same length (which is different from compare() which uses the...
Definition: basic_string_view.hpp:1099
constexpr bool operator==(bsl::basic_string_view< CharT, Traits > const &lhs, bsl::basic_string_view< CharT, Traits > const &rhs) noexcept
Returns true if two strings have the same length (which is different from compare() which uses the mi...
Definition: basic_string_view.hpp:1018
constexpr const_iterator_type citer(size_type const i) const noexcept
Returns an iterator to the element "i" in the view.
Definition: basic_string_view.hpp:375
Used by fmt to determine how to format the output of an fmt command. See the documentation fo bsl::fm...
Definition: fmt_options.hpp:141
constexpr basic_string_view() noexcept=default
Default constructor that creates a basic_string_view with data() == nullptr and size() == 0....
constexpr iterator_type end() noexcept
Returns an iterator to one past the last element of the view. If you attempt to access this iterator,...
Definition: basic_string_view.hpp:392
constexpr const_iterator_type iter(size_type const i) const noexcept
Returns an iterator to the element "i" in the view.
Definition: basic_string_view.hpp:361
constexpr reverse_iterator_type rbegin() noexcept
Returns a reverse iterator to one past the last element of the view. When accessing the iterator,...
Definition: basic_string_view.hpp:445
CharT const * const_pointer_type
alias for: CharT const const *
Definition: basic_string_view.hpp:76
contiguous_iterator< CharT const > iterator_type
alias for: contiguous_iterator<CharT const>
Definition: basic_string_view.hpp:78
constexpr const_reverse_iterator_type riter(size_type const i) const noexcept
Returns a reverse iterator element "i" in the view. When accessing the iterator, the iterator will al...
Definition: basic_string_view.hpp:524
constexpr basic_string_view & remove_suffix(size_type const n) noexcept
Moves the end of the view back by n characters. If n >= size(), the bsl::basic_string_view is reset t...
Definition: basic_string_view.hpp:715
constexpr iterator_type begin() noexcept
Returns an iterator to the first element of the view.
Definition: basic_string_view.hpp:307
constexpr pointer_type front_if() noexcept
Returns a pointer to the instance of T stored at index "0". If the index is out of bounds,...
Definition: basic_string_view.hpp:209
constexpr const_iterator_type cbegin() const noexcept
Returns an iterator to the first element of the view.
Definition: basic_string_view.hpp:333
constexpr const_reverse_iterator_type crend() const noexcept
Returns a reverse iterator first element of the view. When accessing the iterator,...
Definition: basic_string_view.hpp:603
static constexpr size_type max_size() noexcept
Returns the max number of elements the BSL supports.
Definition: basic_string_view.hpp:663
constexpr bsl::int32 compare(size_type pos1, size_type count1, basic_string_view const &str, size_type pos2, size_type count2) const noexcept
Same as substr(pos1, count1).compare(v.substr(pos2, count2))
Definition: basic_string_view.hpp:800
constexpr bool operator==(bsl::basic_string_view< CharT, Traits > const &lhs, CharT const *const rhs) noexcept
Returns true if two strings have the same length (which is different from compare() which uses the mi...
Definition: basic_string_view.hpp:1049
CharT const value_type
alias for: CharT const
Definition: basic_string_view.hpp:64
constexpr const_pointer_type back_if() const noexcept
Returns a pointer to the instance of T stored at index "size() - 1". If the index is out of bounds,...
Definition: basic_string_view.hpp:260
constexpr bool operator==(CharT const *const lhs, bsl::basic_string_view< CharT, Traits > const &rhs) noexcept
Returns true if two strings have the same length (which is different from compare() which uses the mi...
Definition: basic_string_view.hpp:1074
constexpr bool operator!=(CharT const *const lhs, bsl::basic_string_view< CharT, Traits > const &rhs) noexcept
Returns true if two strings are not the same length (which is different from compare() which uses the...
Definition: basic_string_view.hpp:1151
constexpr bool ends_with(value_type const c) const noexcept
Checks if the string ends with the given suffix.
Definition: basic_string_view.hpp:949
constexpr const_reverse_iterator_type crbegin() const noexcept
Returns a reverse iterator to one past the last element of the view. When accessing the iterator,...
Definition: basic_string_view.hpp:483
constexpr size_type length() const noexcept
Returns the length of the string being viewed. This is the same as bsl::basic_string_view::size()....
Definition: basic_string_view.hpp:650
bsl::uintmax difference_type
alias for: bsl::uintmax
Definition: basic_string_view.hpp:68
static constexpr T max() noexcept
Returns the max value of T.
Definition: numeric_limits.hpp:154
constexpr basic_string_view & operator=(pointer_type const s) &noexcept
ptr assignment. This assigns a bsl::basic_string_view a pointer to a string. The number of characters...
Definition: basic_string_view.hpp:141
constexpr bsl::int32 compare(size_type pos, size_type count, pointer_type const str) const noexcept
Same as substr(pos, count).compare(basic_string_view{s})
Definition: basic_string_view.hpp:835
constexpr const_pointer_type data() const noexcept
Returns a pointer to the string being viewed. If this is a default constructed view,...
Definition: basic_string_view.hpp:294
constexpr const_iterator_type begin() const noexcept
Returns an iterator to the first element of the view.
Definition: basic_string_view.hpp:320
constexpr pointer_type at_if(size_type const index) noexcept
Returns a pointer to the instance of T stored at index "index". If the index is out of bounds,...
Definition: basic_string_view.hpp:166
CharT const & reference_type
alias for: CharT const &
Definition: basic_string_view.hpp:70
Provides a reverse iterator as defined by the C++ specification, with the follwing differences:
Definition: reverse_iterator.hpp:78
constexpr bool starts_with(basic_string_view const &str) const noexcept
Checks if the string begins with the given prefix.
Definition: basic_string_view.hpp:877
constexpr bool starts_with(pointer_type const str) const noexcept
Checks if the string begins with the given prefix.
Definition: basic_string_view.hpp:915
::int32_t int32
defines an 32bit signed integer
Definition: cstdint.hpp:40
constexpr size_type size_bytes() const noexcept
Returns size() * sizeof(T)
Definition: basic_string_view.hpp:676
constexpr const_reverse_iterator_type criter(size_type const i) const noexcept
Returns a reverse iterator element "i" in the view. When accessing the iterator, the iterator will al...
Definition: basic_string_view.hpp:545
constexpr bool ends_with(pointer_type const str) const noexcept
Checks if the string ends with the given suffix.
Definition: basic_string_view.hpp:968
constexpr const_iterator_type end() const noexcept
Returns an iterator to one past the last element of the view. If you attempt to access this iterator,...
Definition: basic_string_view.hpp:409
constexpr bsl::int32 compare(basic_string_view const &str) const noexcept
Compares two strings.
Definition: basic_string_view.hpp:763
constexpr const_iterator_type cend() const noexcept
Returns an iterator to one past the last element of the view. If you attempt to access this iterator,...
Definition: basic_string_view.hpp:426
constexpr size_type size() const noexcept
Returns the number of elements in the string being viewed. If this is a default constructed view,...
Definition: basic_string_view.hpp:633
constexpr const_pointer_type at_if(size_type const index) const noexcept
Returns a pointer to the instance of T stored at index "index". If the index is out of bounds,...
Definition: basic_string_view.hpp:188
constexpr basic_string_view substr(size_type const pos=0U, size_type const count=npos) const noexcept
Returns a new bsl::basic_string_view that is a substring view of the original. The substring starts a...
Definition: basic_string_view.hpp:745
constexpr bool ends_with(basic_string_view const &str) const noexcept
Checks if the string ends with the given suffix.
Definition: basic_string_view.hpp:930
CharT const & const_reference_type
alias for: CharT const &
Definition: basic_string_view.hpp:72
contiguous_iterator< CharT const > const_iterator_type
alias for: contiguous_iterator<CharT const const>
Definition: basic_string_view.hpp:80
CharT const * pointer_type
alias for: CharT const *
Definition: basic_string_view.hpp:74
constexpr bsl::int32 compare(pointer_type const str) const noexcept
Same as compare(basic_string_view{s})
Definition: basic_string_view.hpp:819
reverse_iterator< const_iterator_type > const_reverse_iterator_type
alias for: reverse_iterator<const_iterator>
Definition: basic_string_view.hpp:84
constexpr void fmt_impl(OUT &&o, fmt_options const &ops, basic_string_view< CharT > const &str) noexcept
This function is responsible for implementing bsl::fmt for string_view types. For strings,...
Definition: basic_string_view.hpp:1171
constexpr reverse_iterator_type riter(size_type const i) noexcept
Returns a reverse iterator element "i" in the view. When accessing the iterator, the iterator will al...
Definition: basic_string_view.hpp:503
constexpr T const & min_of(T const &a, T const &b) noexcept
Returns a if a is smaller than b, otherwise returns b. Note that this function is called min_of to pr...
Definition: min_of.hpp:47
::uintmax_t uintmax
defines a unsigned integer with the maximum possible size
Definition: cstdint.hpp:97
constexpr bsl::int32 compare(size_type pos, size_type count1, pointer_type const str, size_type count2) const noexcept
Same as substr(pos, count1).compare(basic_string_view{s, count2})
Definition: basic_string_view.hpp:858
bsl::uintmax size_type
alias for: bsl::uintmax
Definition: basic_string_view.hpp:66
Provides a contiguous iterator as defined by the C++ specification, with the follwing differences:
Definition: contiguous_iterator.hpp:76