Fix static_string not allowing move construction

This commit is contained in:
rexy712 2020-04-18 09:47:10 -07:00
parent 8d51604f02
commit 72f8c0d592
3 changed files with 12 additions and 7 deletions

View File

@ -149,8 +149,8 @@ namespace rexy{
~static_string(void) = default; ~static_string(void) = default;
static_string& operator=(const char* c); static_string& operator=(const char* c);
static_string& operator=(const static_string& s); constexpr static_string& operator=(const static_string& s);
static_string& operator=(static_string&&) = delete; constexpr static_string& operator=(static_string&&);
}; };

View File

@ -240,6 +240,16 @@ namespace rexy{
string_base(s.m_data, s.m_length, s.m_length){} string_base(s.m_data, s.m_length, s.m_length){}
constexpr static_string::static_string(static_string&& s): constexpr static_string::static_string(static_string&& s):
string_base(s.m_data, s.m_length, s.m_length){} string_base(s.m_data, s.m_length, s.m_length){}
constexpr static_string& static_string::operator=(const static_string& s){
m_data = s.m_data;
m_length = s.m_length;
return *this;
}
constexpr static_string& static_string::operator=(static_string&& s){
m_data = s.m_data;
m_length = s.m_length;
return *this;
}
namespace detail{ namespace detail{
template<class Targ> template<class Targ>

View File

@ -40,10 +40,5 @@ namespace rexy{
m_length = strlen(c); m_length = strlen(c);
return *this; return *this;
} }
static_string& static_string::operator=(const static_string& s){
m_data = s.m_data;
m_length = s.m_length;
return *this;
}
} }