feat fix GUARDED_BY
All checks were successful
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 52s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 45s

This commit is contained in:
tqcq 2024-03-16 16:46:49 +08:00
parent 193826df35
commit af0d3df984
2 changed files with 4 additions and 3 deletions

View File

@ -14,7 +14,8 @@
#if defined(GUARDED_BY) #if defined(GUARDED_BY)
#undef GUARDED_BY #undef GUARDED_BY
#endif #endif
#define GUARDED_BY(x) __attribute__((guarded_by(x)))
#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
#if defined(__clang__) #if defined(__clang__)
#define EXCLUSIVE_TRYLOCK_FUNCTION(...) THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__)) #define EXCLUSIVE_TRYLOCK_FUNCTION(...) THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__))

View File

@ -96,13 +96,13 @@ public:
T &&value() && T &&value() &&
{ {
CheckHasValue(); CheckHasValue();
return **this; return std::move(**this);
} }
T const &&value() const && T const &&value() const &&
{ {
CheckHasValue(); CheckHasValue();
return **this; return std::move(**this);
} }
T &value_or(T &&val) & T &value_or(T &&val) &