[Interest] QFlags: Typesafe way to check "any flag set"
Schimkowitsch Robert
Robert.Schimkowitsch at andritz.com
Wed Feb 18 13:00:03 CET 2026
When I look at qflags.h in 6.10.2, I notice that there is
constexpr inline bool operator!() const noexcept { return !i; }
…but operator bool() is listed in the non-TYPESAFE section.
Does this mean that if I want to check if any flag is set, I need to do this?
// Check if any flag is set
if ( !! flags)
{ /* do something */ }
Kind regards
Robert
________________________________
This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system.
ANDRITZ HYDRO GmbH
Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation
Firmensitz/ Registered seat: Wien
Firmenbuchgericht/ Court of registry: Handelsgericht Wien
Firmenbuchnummer/ Company registration: FN 61833 g
DVR: 0605077
UID-Nr.: ATU14756806
Thank You
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20260218/8c6963d3/attachment.htm>
More information about the Interest
mailing list