java/Ref: add move operator
This commit is contained in:
parent
16d187b7ed
commit
a52ce7bb7b
@ -68,8 +68,12 @@ namespace Java {
|
|||||||
env->DeleteLocalRef(value);
|
env->DeleteLocalRef(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalRef(const LocalRef &other) = delete;
|
LocalRef &operator=(LocalRef &&src) noexcept {
|
||||||
LocalRef &operator=(const LocalRef &other) = delete;
|
using std::swap;
|
||||||
|
swap(env, src.env);
|
||||||
|
swap(value, src.value);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
JNIEnv *GetEnv() const noexcept {
|
JNIEnv *GetEnv() const noexcept {
|
||||||
return env;
|
return env;
|
||||||
|
Loading…
Reference in New Issue
Block a user