[libcxx-commits] [PATCH] D95251: Remove noexcept from basic_string::find and implementation functions.
Marshall Clow via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jan 22 14:39:04 PST 2021
mclow.lists added a comment.
In D95251#2516668 <https://reviews.llvm.org/D95251#2516668>, @CaseyCarter wrote:
> In D95251#2516256 <https://reviews.llvm.org/D95251#2516256>, @zoecarver wrote:
>
>> In the issue, I'll ask for clarification and propose either that all these find-like members are marked noexcept or none of them are. The thing that's really making me uneasy is that two of them are and the rest aren't.
>
> It's probably a wide vs. narrow contract thing. The find overloads that take const char*, for example, have a precondition that the pointer is non-null. Under the so-called "Lakos rule" they would/could/should be "Throws: Nothing" but not noexcept.
that was my thought, too.
However, having a noexcept function that is required to call a non-noexcept function is madness :-)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95251/new/
https://reviews.llvm.org/D95251
More information about the libcxx-commits
mailing list