Skip to content

Commit 4b053d2

Browse files
committed
update cplx for CXX != CXX20
1 parent 88fd62b commit 4b053d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

inst/include/cpp4r/complexes.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ class r_vector<r_complex>::proxy {
326326

327327
#if !CPP4R_HAS_CXX20
328328
// C++20 automatically generates operator!= from operator==
329-
friend bool operator!=(const proxy& lhs, const r_complex& rhs) { return !(lhs == rhs); }
329+
friend bool operator!=(const proxy& lhs, const r_complex& rhs) {
330+
return !(static_cast<r_complex>(lhs) == rhs);
331+
}
330332
#endif
331333

332334
private:

0 commit comments

Comments
 (0)