Skip to content

Commit 52f9f71

Browse files
committed
Merge branch 'dev'
2 parents 789c6ae + 6bdfed7 commit 52f9f71

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

lib/inc/sys_string/impl/platform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110

111111
#endif
112112

113-
#elif defined(__linux__) || defined(__FreeBSD__)
113+
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__unix__)
114114
#include <sys_string/impl/platforms/unix_generic.h>
115115

116116

lib/inc/sys_string/impl/platforms/android_java.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ namespace sysstr
9090
using super::size;
9191
using super::operator[];
9292

93-
auto swap(storage & other) noexcept -> void
93+
auto swap(android_storage & other) noexcept -> void
9494
{ super::swap(other); }
9595

9696
private:

lib/inc/sys_string/impl/platforms/unix_generic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace sysstr
8787
using super::size;
8888
using super::operator[];
8989

90-
auto swap(storage & other) noexcept -> void
90+
auto swap(generic_storage & other) noexcept -> void
9191
{ super::swap(other); }
9292
};
9393
}

lib/inc/sys_string/impl/platforms/windows_generic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace sysstr
8282
using super::size;
8383
using super::operator[];
8484

85-
auto swap(storage & other) noexcept -> void
85+
auto swap(win_generic_storage & other) noexcept -> void
8686
{ super::swap(other); }
8787
};
8888
}

lib/inc/sys_string/sys_string.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ namespace sysstr
197197
#endif
198198

199199
auto swap(sys_string_t & other) noexcept -> void
200-
{ storage::swap(other.m_storage); }
201-
200+
{ storage::swap(static_cast<storage &>(other)); }
201+
202202
friend auto swap(sys_string_t & lhs, sys_string_t & rhs) noexcept -> void
203203
{ lhs.swap(rhs); }
204204

test/test_general.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ TEST_CASE( "Creation", "[general]") {
6666
sys_string temp = S("abc");
6767
sys_string new_temp(std::move(temp));
6868
CHECK(new_temp == S("abc"));
69+
70+
temp = S("abc");
71+
new_temp = S("xyz");
72+
swap(temp, new_temp);
73+
CHECK(temp == S("xyz"));
74+
CHECK(new_temp == S("abc"));
6975
}
7076

7177
TEST_CASE( "Iteration", "[general]" ) {

0 commit comments

Comments
 (0)