Skip to content

Conversation

@H-G-Hristov
Copy link
Contributor

@H-G-Hristov H-G-Hristov commented Dec 14, 2025

[[nodiscard]] should be applied to functions where discarding the return value is most likely a correctness issue.

Towards #172124

@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/nodiscard-to-iterators branch from aef92a8 to 15bf252 Compare December 14, 2025 09:06
@github-actions
Copy link

github-actions bot commented Dec 14, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/nodiscard-to-iterators branch 4 times, most recently from e252dd0 to 16806f9 Compare December 15, 2025 06:59
`[[nodiscard]]` should be applied to functions where discarding the return value is most likely a correctness issue.

- https://libcxx.llvm.org/CodingGuidelines.htm
- https://wg21.link/iterators

Towards llvm#172124
@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/nodiscard-to-iterators branch from 16806f9 to 7061781 Compare December 15, 2025 07:09
Comment on lines -215 to +222
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
#ifndef _LIBCPP_CXX03_LANG
auto
operator-(const __wrap_iter<_Iter1>& __x,
const __wrap_iter<_Iter2>& __y) _NOEXCEPT->decltype(__x.base() - __y.base())
auto operator-(const __wrap_iter<_Iter1>& __x,
const __wrap_iter<_Iter2>& __y) _NOEXCEPT->decltype(__x.base() - __y.base())
Copy link
Contributor

@Zingam Zingam Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By Code Formatter CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants