Skip to content

Commit 2488899

Browse files
committed
Format C++ code with clang-format 18
1 parent d33599d commit 2488899

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

include/cxx.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class String final {
5353
static String lossy(const char16_t *) noexcept;
5454
static String lossy(const char16_t *, std::size_t) noexcept;
5555

56-
String &operator=(const String &) &noexcept;
57-
String &operator=(String &&) &noexcept;
56+
String &operator=(const String &) & noexcept;
57+
String &operator=(String &&) & noexcept;
5858

5959
explicit operator std::string() const;
6060

@@ -113,7 +113,7 @@ class Str final {
113113
Str(const char *);
114114
Str(const char *, std::size_t);
115115

116-
Str &operator=(const Str &) &noexcept = default;
116+
Str &operator=(const Str &) & noexcept = default;
117117

118118
explicit operator std::string() const;
119119

@@ -161,8 +161,8 @@ template <>
161161
struct copy_assignable_if<false> {
162162
copy_assignable_if() noexcept = default;
163163
copy_assignable_if(const copy_assignable_if &) noexcept = default;
164-
copy_assignable_if &operator=(const copy_assignable_if &) &noexcept = delete;
165-
copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default;
164+
copy_assignable_if &operator=(const copy_assignable_if &) & noexcept = delete;
165+
copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default;
166166
};
167167
} // namespace detail
168168

@@ -179,8 +179,8 @@ class Slice final
179179
template <typename C>
180180
explicit Slice(C &c) : Slice(c.data(), c.size()) {}
181181

182-
Slice &operator=(const Slice<T> &) &noexcept = default;
183-
Slice &operator=(Slice<T> &&) &noexcept = default;
182+
Slice &operator=(const Slice<T> &) & noexcept = default;
183+
Slice &operator=(Slice<T> &&) & noexcept = default;
184184

185185
T *data() const noexcept;
186186
std::size_t size() const noexcept;
@@ -281,7 +281,7 @@ class Box final {
281281
explicit Box(const T &);
282282
explicit Box(T &&);
283283

284-
Box &operator=(Box &&) &noexcept;
284+
Box &operator=(Box &&) & noexcept;
285285

286286
const T *operator->() const noexcept;
287287
const T &operator*() const noexcept;
@@ -326,7 +326,7 @@ class Vec final {
326326
Vec(Vec &&) noexcept;
327327
~Vec() noexcept;
328328

329-
Vec &operator=(Vec &&) &noexcept;
329+
Vec &operator=(Vec &&) & noexcept;
330330
Vec &operator=(const Vec &) &;
331331

332332
std::size_t size() const noexcept;
@@ -407,7 +407,7 @@ class Error final : public std::exception {
407407
~Error() noexcept override;
408408

409409
Error &operator=(const Error &) &;
410-
Error &operator=(Error &&) &noexcept;
410+
Error &operator=(Error &&) & noexcept;
411411

412412
const char *what() const noexcept override;
413413

@@ -779,7 +779,7 @@ Box<T>::~Box() noexcept {
779779
}
780780

781781
template <typename T>
782-
Box<T> &Box<T>::operator=(Box &&other) &noexcept {
782+
Box<T> &Box<T>::operator=(Box &&other) & noexcept {
783783
if (this->ptr) {
784784
this->drop();
785785
}
@@ -867,7 +867,7 @@ Vec<T>::~Vec() noexcept {
867867
}
868868

869869
template <typename T>
870-
Vec<T> &Vec<T>::operator=(Vec &&other) &noexcept {
870+
Vec<T> &Vec<T>::operator=(Vec &&other) & noexcept {
871871
this->drop();
872872
this->repr = other.repr;
873873
new (&other) Vec();

src/cxx.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,15 @@ String String::lossy(const char16_t *s, std::size_t len) noexcept {
186186
return String(lossy_t{}, s, len);
187187
}
188188

189-
String &String::operator=(const String &other) &noexcept {
189+
String &String::operator=(const String &other) & noexcept {
190190
if (this != &other) {
191191
cxxbridge1$string$drop(this);
192192
cxxbridge1$string$clone(this, other);
193193
}
194194
return *this;
195195
}
196196

197-
String &String::operator=(String &&other) &noexcept {
197+
String &String::operator=(String &&other) & noexcept {
198198
cxxbridge1$string$drop(this);
199199
this->repr = other.repr;
200200
cxxbridge1$string$new(&other);
@@ -487,7 +487,7 @@ Error &Error::operator=(const Error &other) & {
487487
return *this;
488488
}
489489

490-
Error &Error::operator=(Error &&other) &noexcept {
490+
Error &Error::operator=(Error &&other) & noexcept {
491491
std::exception::operator=(std::move(other));
492492
delete[] this->msg;
493493
this->msg = other.msg;

0 commit comments

Comments
 (0)