Skip to content

Commit a7bbc67

Browse files
committed
Fixed abs error identified in #326
Thanks to @mhoemmen for the suggestion!
1 parent 79fc821 commit a7bbc67

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

include/experimental/__p1673_bits/proxy_reference.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,7 @@ class proxy_reference : proxy_reference_base {
140140
P1673_PROXY_REFERENCE_ARITHMETIC_OPERATOR( / )
141141

142142
friend auto abs(const derived_type& x) {
143-
if constexpr (std::is_unsigned_v<value_type>) {
144-
return value_type(static_cast<const this_type&>(x));
145-
} else {
146-
return std::abs(value_type(static_cast<const this_type&>(x)));
147-
}
143+
return impl::abs_if_needed(value_type(static_cast<const this_type&>(x)));
148144
}
149145

150146
friend auto real(const derived_type& x) {

0 commit comments

Comments
 (0)