summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobalstatic.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-04-01 11:17:20 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-04-03 16:18:42 +0200
commit01dab0b953b945a46492efc6eccb54bab07287b6 (patch)
tree696cdbcb384fa9b054249364174ceb277835a21f /src/corelib/global/qglobalstatic.h
parentb0e4d53b637e6c34457d14ed3f0be705098bf2f5 (diff)
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>
Diffstat (limited to 'src/corelib/global/qglobalstatic.h')
-rw-r--r--src/corelib/global/qglobalstatic.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h
index beecc1f000..f758baf15d 100644
--- a/src/corelib/global/qglobalstatic.h
+++ b/src/corelib/global/qglobalstatic.h
@@ -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());
}