@@ -27,11 +27,11 @@ class basic_string_view {
2727 public:
2828 typedef traits traits_type;
2929 typedef charT value_type;
30- typedef charT* pointer;
31- typedef const charT* const_pointer;
32- typedef charT& reference;
33- typedef const charT& const_reference;
34- typedef const charT* const_iterator;
30+ typedef charT * pointer;
31+ typedef const charT * const_pointer;
32+ typedef charT & reference;
33+ typedef const charT & const_reference;
34+ typedef const charT * const_iterator;
3535 typedef const_iterator iterator;
3636 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
3737 typedef const_reverse_iterator reverse_iterator;
@@ -47,32 +47,31 @@ class basic_string_view {
4747 /* *
4848 * \brief Copy constructor.
4949 */
50- constexpr basic_string_view (const basic_string_view&) noexcept = default;
50+ constexpr basic_string_view (const basic_string_view &) noexcept = default;
5151
5252 /* *
5353 * \brief Assignment operator.
5454 */
55- basic_string_view& operator =(const basic_string_view&) noexcept = default ;
55+ basic_string_view & operator =(const basic_string_view &) noexcept = default ;
5656
5757 /* *
5858 * \brief Constructor.
5959 */
6060 template <class Allocator >
6161 basic_string_view (
62- const std::basic_string<charT, traits, Allocator>& str) noexcept
63- : data_(str.data()),
64- size_ (str.size()) {}
62+ const std::basic_string<charT, traits, Allocator> &str) noexcept
63+ : data_(str.data()), size_(str.size()) {}
6564
6665 /* *
6766 * \brief Constructor.
6867 */
69- constexpr basic_string_view (const charT* str)
68+ constexpr basic_string_view (const charT * str)
7069 : data_(str), size_(traits::length(str)) {}
7170
7271 /* *
7372 * \brief Constructor.
7473 */
75- constexpr basic_string_view (const charT* str, size_type len)
74+ constexpr basic_string_view (const charT * str, size_type len)
7675 : data_(str), size_(len) {}
7776
7877 constexpr const_iterator begin () const noexcept { return data_; }
@@ -133,7 +132,7 @@ class basic_string_view {
133132
134133 void remove_suffix (size_type n) { size_ -= n; }
135134
136- void swap (basic_string_view& s) noexcept {
135+ void swap (basic_string_view & s) noexcept {
137136 std::swap (data_, s.data_ );
138137 std::swap (size_, s.size_ );
139138 }
@@ -145,11 +144,11 @@ class basic_string_view {
145144
146145 template <class Allocator = std::allocator<charT>>
147146 std::basic_string<charT, traits, Allocator> to_string (
148- const Allocator& a = Allocator()) const {
147+ const Allocator & a = Allocator()) const {
149148 return std::basic_string<charT, traits, Allocator>(begin (), end (), a);
150149 }
151150
152- size_type copy (charT* s, size_type n, size_type pos = 0 ) const {
151+ size_type copy (charT * s, size_type n, size_type pos = 0 ) const {
153152 size_type rlen = std::min (n, size () - pos);
154153 std::copy_n (begin () + pos, rlen, s);
155154 return rlen;
@@ -179,15 +178,15 @@ class basic_string_view {
179178 return substr (pos1, n1).compare (s.substr (pos2, n2));
180179 }
181180
182- constexpr int compare (const charT* s) const {
181+ constexpr int compare (const charT * s) const {
183182 return compare (basic_string_view (s));
184183 }
185184
186- constexpr int compare (size_type pos1, size_type n1, const charT* s) const {
185+ constexpr int compare (size_type pos1, size_type n1, const charT * s) const {
187186 return substr (pos1, n1).compare (basic_string_view (s));
188187 }
189188
190- constexpr int compare (size_type pos1, size_type n1, const charT* s,
189+ constexpr int compare (size_type pos1, size_type n1, const charT * s,
191190 size_type n2) const {
192191 return substr (pos1, n1).compare (basic_string_view (s, n2));
193192 }
@@ -261,8 +260,8 @@ constexpr bool operator>=(basic_string_view<charT, traits> lhs,
261260 * \brief Output stream operator.
262261 */
263262template <class charT , class traits >
264- std::basic_ostream<charT, traits>& operator <<(
265- std::basic_ostream<charT, traits>& os,
263+ std::basic_ostream<charT, traits> & operator <<(
264+ std::basic_ostream<charT, traits> & os,
266265 basic_string_view<charT, traits> str) {
267266 return os << str.to_string ();
268267}
0 commit comments