[libc++] span: Fix incorrect static asserts
The static asserts in span<T, N>::front() and span<T, N>::back() are incorrect as they may be triggered from valid code due to evaluation of a never taken branch: span<int, 0> foo; if (!foo.empty()) { auto x = foo.front(); } The problem is that the branch is always evaluated by the compiler, creating invalid compile errors for span<T, 0>. Thanks to Michael Schellenberger Costa for the patch. Differential Revision: https://reviews.llvm.org/D71995
Loading
Please register or sign in to comment