Commit a52ce7bb authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

java/Ref: add move operator

parent 16d187b7
......@@ -68,8 +68,12 @@ namespace Java {
env->DeleteLocalRef(value);
}
LocalRef(const LocalRef &other) = delete;
LocalRef &operator=(const LocalRef &other) = delete;
LocalRef &operator=(LocalRef &&src) noexcept {
using std::swap;
swap(env, src.env);
swap(value, src.value);
return *this;
}
JNIEnv *GetEnv() const noexcept {
return env;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment