Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve iota_view's iterator's binary operator+ (LWG-3580) #2417

Merged
merged 3 commits into from
Dec 17, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -1140,16 +1140,18 @@ namespace ranges {
// clang-format on

_NODISCARD friend constexpr _Ioterator operator+(_Ioterator _It, const difference_type _Off) noexcept(
noexcept(static_cast<_Wi>(_It._Current + _Off))) /* strengthened */ requires _Advanceable<_Wi> {
return _Ioterator{static_cast<_Wi>(_It._Current + _Off)};
noexcept(_It._Current += _Off)) /* strengthened */ requires _Advanceable<_Wi> {
_It._Current += _Off;
return _It;
fsb4000 marked this conversation as resolved.
Show resolved Hide resolved
}
_NODISCARD friend constexpr _Ioterator operator+(const difference_type _Off, _Ioterator _It) noexcept(
noexcept(static_cast<_Wi>(_It._Current + _Off))) /* strengthened */ requires _Advanceable<_Wi> {
return _Ioterator{static_cast<_Wi>(_It._Current + _Off)};
}
_NODISCARD friend constexpr _Ioterator operator-(_Ioterator _It, const difference_type _Off) noexcept(
noexcept(static_cast<_Wi>(_It._Current - _Off))) /* strengthened */ requires _Advanceable<_Wi> {
return _Ioterator{static_cast<_Wi>(_It._Current - _Off)};
noexcept(_It._Current -= _Off)) /* strengthened */ requires _Advanceable<_Wi> {
_It._Current -= _Off;
return _It;
}
_NODISCARD friend constexpr difference_type
operator-(const _Ioterator& _Left, const _Ioterator& _Right) noexcept(
Expand Down