Skip to content

Commit 9c34229

Browse files
authored
Merge pull request #9 from SGSSGene/fix/improved_cpp_code
Fix/improved cpp code
2 parents 5afe15d + 9bf9976 commit 9c34229

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ CXXFLAGS += -Werror -Wextra -Wall
2424

2525
cwl_v1_2.h: FORCE
2626
schema-salad-tool --codegen cpp \
27+
--codegen-spdx-copyright-text "Copyright 2016-2023 CWL Project Contributors" \
28+
--codegen-spdx-license-identifier "Apache-2.0" \
2729
https://github.com/common-workflow-language/cwl-v1.2/raw/1.2.1_proposed/CommonWorkflowLanguage.yml \
2830
> $@
2931

cwl_v1_2.h

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-FileCopyrightText: Copyright 2016-2023 CWL Project Contributors
2+
// SPDX-License-Identifier: Apache-2.0
13
#pragma once
24

35
/* This file was generated using schema-salad code generator.
@@ -172,24 +174,26 @@ class heap_object {
172174
heap_object(heap_object const& oth) {
173175
*data = *oth;
174176
}
175-
heap_object(heap_object&& oth) {
176-
*data = *oth;
177+
heap_object(heap_object&& oth) noexcept(noexcept(*data = std::move(*oth))) {
178+
*data = std::move(*oth);
177179
}
178180

179181
template <typename T2>
180182
heap_object(T2 const& oth) {
181183
*data = oth;
182184
}
183185
template <typename T2>
184-
heap_object(T2&& oth) {
185-
*data = oth;
186+
heap_object(T2&& oth) noexcept(noexcept(*data = std::forward<T2>(oth))) {
187+
*data = std::forward<T2>(oth);
186188
}
187189

190+
~heap_object() = default;
191+
188192
auto operator=(heap_object const& oth) -> heap_object& {
189193
*data = *oth;
190194
return *this;
191195
}
192-
auto operator=(heap_object&& oth) -> heap_object& {
196+
auto operator=(heap_object&& oth) noexcept(noexcept(*data = std::move(*oth))) -> heap_object& {
193197
*data = std::move(*oth);
194198
return *this;
195199
}
@@ -200,21 +204,21 @@ class heap_object {
200204
return *this;
201205
}
202206
template <typename T2>
203-
auto operator=(T2&& oth) -> heap_object& {
204-
*data = std::move(oth);
207+
auto operator=(T2&& oth) noexcept(noexcept(*data = std::forward<T2>(oth))) -> heap_object& {
208+
*data = std::forward<T2>(oth);
205209
return *this;
206210
}
207211

208-
auto operator->() -> T* {
212+
auto operator->() noexcept(true) -> T* {
209213
return data.get();
210214
}
211-
auto operator->() const -> T const* {
215+
auto operator->() const noexcept(true) -> T const* {
212216
return data.get();
213217
}
214-
auto operator*() -> T& {
218+
auto operator*() noexcept(true) -> T& {
215219
return *data;
216220
}
217-
auto operator*() const -> T const& {
221+
auto operator*() const noexcept(true) -> T const& {
218222
return *data;
219223
}
220224
};

0 commit comments

Comments
 (0)