Skip to content

Commit df77e29

Browse files
saturation correct version from main
1 parent b30297e commit df77e29

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libcxx/include/__numeric/saturation_arithmetic.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,27 +121,27 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Rp __saturate_cast(_Tp __x) noexcept {
121121
#if _LIBCPP_STD_VER >= 26
122122

123123
template <__signed_or_unsigned_integer _Tp>
124-
_LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept {
124+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept {
125125
return std::__add_sat(__x, __y);
126126
}
127127

128128
template <__signed_or_unsigned_integer _Tp>
129-
_LIBCPP_HIDE_FROM_ABI constexpr _Tp sub_sat(_Tp __x, _Tp __y) noexcept {
129+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp sub_sat(_Tp __x, _Tp __y) noexcept {
130130
return std::__sub_sat(__x, __y);
131131
}
132132

133133
template <__signed_or_unsigned_integer _Tp>
134-
_LIBCPP_HIDE_FROM_ABI constexpr _Tp mul_sat(_Tp __x, _Tp __y) noexcept {
134+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp mul_sat(_Tp __x, _Tp __y) noexcept {
135135
return std::__mul_sat(__x, __y);
136136
}
137137

138138
template <__signed_or_unsigned_integer _Tp>
139-
_LIBCPP_HIDE_FROM_ABI constexpr _Tp div_sat(_Tp __x, _Tp __y) noexcept {
139+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp div_sat(_Tp __x, _Tp __y) noexcept {
140140
return std::__div_sat(__x, __y);
141141
}
142142

143143
template <__signed_or_unsigned_integer _Rp, __signed_or_unsigned_integer _Tp>
144-
_LIBCPP_HIDE_FROM_ABI constexpr _Rp saturate_cast(_Tp __x) noexcept {
144+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Rp saturate_cast(_Tp __x) noexcept {
145145
return std::__saturate_cast<_Rp>(__x);
146146
}
147147

0 commit comments

Comments
 (0)