[libcxx-commits] [libcxx] [libc++][iterator] Applied `[[nodiscard]]` (PR #172200)
Hristo Hristov via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Dec 17 20:37:37 PST 2025
================
@@ -80,7 +80,8 @@ class __wrap_iter {
--(*this);
return __tmp;
}
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter operator+(difference_type __n) const _NOEXCEPT {
+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter
+ operator+(difference_type __n) const _NOEXCEPT {
----------------
Zingam wrote:
> I personally want they to be annotated `[[__nodiscard__]]` because this seems able to reduce misuses from library implementors.
I'm generally limiting myself to just what's "exposed" to the end user because of capacity (mine and yours) and the amount of what's to be done. I guessed those iterators need annotation but wanted to make sure you are OK with that.
https://github.com/llvm/llvm-project/pull/172200
More information about the libcxx-commits
mailing list