Skip to content

Commit 9634364

Browse files
committed
chore: javascript fixes
1 parent 5b2fa54 commit 9634364

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

include/mrdox/Support/JavaScript.hpp

-6
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,6 @@ class MRDOX_DECL
149149
*/
150150
~Param();
151151

152-
/** Constructor.
153-
154-
Default constructed params have type undefined.
155-
*/
156-
Param() noexcept;
157-
158152
Param(std::nullptr_t) noexcept;
159153
Param(bool) noexcept;
160154
Param(int) noexcept;

source/Support/JavaScript.cpp

+9-12
Original file line numberDiff line numberDiff line change
@@ -224,25 +224,25 @@ Param(
224224
case Kind::Null:
225225
break;
226226
case Kind::Boolean:
227-
b_ = other.b_;
227+
std::construct_at(&b_, other.b_);
228228
break;
229229
case Kind::Integer:
230-
i_ = other.i_;
230+
std::construct_at(&i_, other.i_);
231231
break;
232232
case Kind::Unsigned:
233-
u_ = other.u_;
233+
std::construct_at(&u_, other.u_);
234234
break;
235235
case Kind::Double:
236-
d_ = other.d_;
236+
std::construct_at(&d_, other.d_);
237237
break;
238238
case Kind::String:
239-
s_ = other.s_;
239+
std::construct_at(&s_, other.s_);
240240
break;
241241
case Kind::Value:
242-
idx_ = other.idx_;
242+
std::construct_at(&idx_, other.idx_);
243243
break;
244244
case Kind::DomObject:
245-
obj_ = other.obj_;
245+
std::construct_at(&obj_, other.obj_);
246246
break;
247247
}
248248
}
@@ -268,21 +268,18 @@ Param::
268268
case Kind::Double:
269269
break;
270270
case Kind::String:
271-
s_.~basic_string_view();
271+
std::destroy_at(&s_);
272272
break;
273273
case Kind::Value:
274274
break;
275275
case Kind::DomObject:
276-
obj_.~Pointer();
276+
std::destroy_at(&obj_);
277277
break;
278278
default:
279279
MRDOX_UNREACHABLE();
280280
}
281281
}
282282

283-
Param::
284-
Param() noexcept = default;
285-
286283
Param::
287284
Param(
288285
std::nullptr_t) noexcept

0 commit comments

Comments
 (0)