Skip to content

Commit 9bf9976

Browse files
committed
patch: updated the generated code
1 parent c9b5473 commit 9bf9976

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

cwl_v1_2.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,24 +174,26 @@ class heap_object {
174174
heap_object(heap_object const& oth) {
175175
*data = *oth;
176176
}
177-
heap_object(heap_object&& oth) {
178-
*data = *oth;
177+
heap_object(heap_object&& oth) noexcept(noexcept(*data = std::move(*oth))) {
178+
*data = std::move(*oth);
179179
}
180180

181181
template <typename T2>
182182
heap_object(T2 const& oth) {
183183
*data = oth;
184184
}
185185
template <typename T2>
186-
heap_object(T2&& oth) {
187-
*data = oth;
186+
heap_object(T2&& oth) noexcept(noexcept(*data = std::forward<T2>(oth))) {
187+
*data = std::forward<T2>(oth);
188188
}
189189

190+
~heap_object() = default;
191+
190192
auto operator=(heap_object const& oth) -> heap_object& {
191193
*data = *oth;
192194
return *this;
193195
}
194-
auto operator=(heap_object&& oth) -> heap_object& {
196+
auto operator=(heap_object&& oth) noexcept(noexcept(*data = std::move(*oth))) -> heap_object& {
195197
*data = std::move(*oth);
196198
return *this;
197199
}
@@ -202,21 +204,21 @@ class heap_object {
202204
return *this;
203205
}
204206
template <typename T2>
205-
auto operator=(T2&& oth) -> heap_object& {
206-
*data = std::move(oth);
207+
auto operator=(T2&& oth) noexcept(noexcept(*data = std::forward<T2>(oth))) -> heap_object& {
208+
*data = std::forward<T2>(oth);
207209
return *this;
208210
}
209211

210-
auto operator->() -> T* {
212+
auto operator->() noexcept(true) -> T* {
211213
return data.get();
212214
}
213-
auto operator->() const -> T const* {
215+
auto operator->() const noexcept(true) -> T const* {
214216
return data.get();
215217
}
216-
auto operator*() -> T& {
218+
auto operator*() noexcept(true) -> T& {
217219
return *data;
218220
}
219-
auto operator*() const -> T const& {
221+
auto operator*() const noexcept(true) -> T const& {
220222
return *data;
221223
}
222224
};

0 commit comments

Comments
 (0)