Open 0Litost0 opened 11 months ago
What compiler are you using?
Line 34 of DataRef_jni.cpp is
classObject = jniFindClass("java/nio/ByteBuffer");
which is indeed a call to the assignment but it should be a call to the move assignment because on the right hand is a function calljniFindClass()
, so it should be an r-value.
the GlobalRef
class has a user defined move assignment operator
GlobalRef& operator=(GlobalRef&& other) noexcept {
So I don't see why this would fail to compile.
当我将 snap-djinni 移植到自己的项目,并尝试使用 DataRef时,有以下报错:
DataRef_jni.cpp:34:25: error: object of type 'GlobalRef<jclass>' (aka 'GlobalRef<_jclass *>') cannot be assigned because its copy assignment operator is implicitly deleted classObject = jniFindClass("java/nio/ByteBuffer");
The tips are as follows:
copy assignment operator is implicitly deleted because 'GlobalRef<_jclass *>' has a user-declared move constructor GlobalRef(GlobalRef && obj)
Have you encountered similar problems? I did not encounter the above problems when I tried to compile and run the demo.