Silence -Wunused-private-field warning on macOS
In file included from src/cxx.cc:1:
src/../include/cxx.h:131:33: error: private field 'repr' is not used [-Werror,-Wunused-private-field]
std::array<std::uintptr_t, 2> repr;
^
diff --git a/src/cxx.cc b/src/cxx.cc
index 9b4357c..15dc998 100644
--- a/src/cxx.cc
+++ b/src/cxx.cc
@@ -273,7 +273,10 @@
bool Str::operator>=(const Str &rhs) const noexcept { return rhs <= *this; }
-void Str::swap(Str &rhs) noexcept { std::swap(*this, rhs); }
+void Str::swap(Str &rhs) noexcept {
+ using std::swap;
+ swap(this->repr, rhs.repr);
+}
std::ostream &operator<<(std::ostream &os, const Str &s) {
os.write(s.data(), s.size());