Closed YarikTH closed 2 years ago
Only thing that bothers me in this PR - test is ugly. It's just copy of test from above, but with a move.
Maybe static_assert(std::is_move_constructable
Another inconvenient thing - move constructor has to be noexcept(false) because member value v8::Global<> is noexcept(false) at least in v8 6.X. Maybe move constructor should be marked as
constexpr bool is_context_move_noexcept = noexcept(std::declval<v8::Global<v8::Context>>().Pass());
context(context&&) noexcept(is_context_move_noexcept);
looks ugly, but at least it will become noexcept as soon as v8::Global's move will become noexcept.
Merged in 9ee366003dc01858be9e0601b3949d112aa2432e, backported to c++17 branch in 21918e08426ec7d1ed54b678caa25a07737b15dd
Thanks a lot! I would also try to add the move assignment operator. Maybe it would be handy to have the movement available other v8pp classes, like
module
,class_
.