StaticString: Add a constructor that takes in another StaticString

This commit is contained in:
apio 2023-03-07 22:18:34 +01:00
parent abdd460525
commit c51b119eb4
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -11,6 +11,11 @@ template <usize Size> class StaticString
adopt(string); adopt(string);
} }
template<usize OSize> StaticString(const StaticString<OSize>& other)
{
adopt(other.chars());
}
void adopt(const char* string) void adopt(const char* string)
{ {
usize length = strlcpy(m_buffer, string, sizeof(m_buffer)); usize length = strlcpy(m_buffer, string, sizeof(m_buffer));