Hi and thanks for your replies! > You will be able to create and destroy QString and QByteArray, find out if > they > are empty or not, get the pointer to the data, but not call almost any other > methods in them.
Yeah, I can see this will be of limited use in real life... > > > Herb Sutter highlighted constexpr as a way to increase programming > > language safety in his recent keynote at Meeting C++. Things like > > making a runtime function constexpr, so you can, at compile time, > > check for UB using static_asserts or such when feeding it with various > > ranges of values (min, max, zero, empty list,...). Now I'm thinking > > about how we could apply those ideas in real code - and Qt mostly > > stops us from doing that, right there and then. > > That's a fallacy. > > The fact that you can do it under constexpr doesn't magically make the same > usage safe when not under constexpr. > Well, my idea was mostly to test extreme cases in constexpr context, so you get compiler errors if you overlooked something and e.g. cause unsigned wraparound when getting passed int_max. But as mentioned above, the number of useful functions I can write constexpr is probably limited. I believe Herb rather meant this example to show that it is possible to reduce the amount of UB allowed in the language. 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 ________________________________ _______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest