[libcxx] [clang] [llvm] [clang-tools-extra] [libc++][span] P2821R5: span.at() (PR #74994)

2023-12-10 Thread Nikolas Klauser via cfe-commits
@@ -343,6 +347,15 @@ public: return __data_[__idx]; } +# if _LIBCPP_STD_VER >= 26 +_LIBCPP_HIDE_FROM_ABI constexpr reference at(size_type __idx) const { + if (__idx >= size()) { +__throw_out_of_range(); + } + return *(data() + __idx);

[libcxx] [clang] [llvm] [clang-tools-extra] [libc++][span] P2821R5: span.at() (PR #74994)

2023-12-10 Thread Mark de Wever via cfe-commits
@@ -343,6 +347,15 @@ public: return __data_[__idx]; } +# if _LIBCPP_STD_VER >= 26 +_LIBCPP_HIDE_FROM_ABI constexpr reference at(size_type __idx) const { mordante wrote: You need to export this declaration from the `modules/span.inc` too.