On 27/08/2024 04:03, Thiago Macieira wrote:
I also urge you to expand on the case of std::vector::operator[]. Are you
proposing that it a) become non-noexcept, b) have its UB not defined by the
boundary of the precondition, or c) have a precondition that cannot be turned
into an exception?

It's not noexcept in the Standard; implementations just chose to make it so. Libstdc++ chose¹ to have always-terminating precondition enforcement, i.e. the checks never throw, and so doesn't operator[].

We can decide otherwise -- and that's orthogonal to if and when contracts actually land, as Marc says.


¹ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58338#c17

--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - Trusted Software Excellence

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to