Closed alexzk1 closed 2 years ago
What is the Godot's branch you are compiling with? I can assume you read that it's for 3.x series right?
What is the Godot's branch you are compiling with? I can assume you read that it's for 3.x series right?
Yes, but expanded macro in warning does not look right. I mean ... returning && is wrong, returning & is wrong unless object is static, like:
inline T& func() { static T a; return a; } that is possible correct use of reference returning. In your case that could be
class Lock { Lock(Lock&&) = default; Lock(const Lock&) = delete; Lock& operator=(const Lock&) = delete; Lock& operator=(Lock&&) = default; }
Lock get() { Lock lock; return lock; // <<-----that will do 100% move here }
Just tried to build things... And got scaring messages, which are hidden behind macros FORCE_INLINE in your code, but, I would check that:
I think proper way is just:
static MutexLock LuaScriptLanguage::acquire()
and then "return lock;"
If lock has proper move constructor/operator compiler will handle that properly. Also if you want be sure MOVE made, delete copiers explicit like MutexLock(const MutexLock&) = delete;