QGlobalStatic: mark functions that inspect the guard noexcept

Because they are.

Pick-to: 6.3
Change-Id: I60e94ebbe6fcd624195aeaed5de76cabc61c3178
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
bb10
Marc Mutz 2022-04-01 11:17:20 +02:00
parent b0e4d53b63
commit 01dab0b953
1 changed files with 3 additions and 3 deletions

View File

@ -94,8 +94,8 @@ template <typename Holder> struct QGlobalStatic
{
using Type = typename Holder::Type;
bool isDestroyed() const { return guardValue() <= QtGlobalStatic::Destroyed; }
bool exists() const { return guardValue() == QtGlobalStatic::Initialized; }
bool isDestroyed() const noexcept { return guardValue() <= QtGlobalStatic::Destroyed; }
bool exists() const noexcept { return guardValue() == QtGlobalStatic::Initialized; }
operator Type *()
{
if (isDestroyed())
@ -127,7 +127,7 @@ protected:
static Holder holder;
return holder.pointer();
}
static QtGlobalStatic::GuardValues guardValue()
static QtGlobalStatic::GuardValues guardValue() noexcept
{
return QtGlobalStatic::GuardValues(Holder::guard.loadAcquire());
}