Add const ref istring constructors (#119)

This commit is contained in:
Arek Sredzki 2019-03-01 11:31:54 -08:00 committed by John Wellbelove
parent 302a82baa6
commit 92fddd7e42
4 changed files with 40 additions and 0 deletions

View File

@ -78,6 +78,16 @@ namespace etl
this->assign(other.begin(), other.end());
}
//*************************************************************************
/// From other istring.
///\param other The other istring.
//*************************************************************************
string(const etl::istring& other)
: istring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->assign(other.begin(), other.end());
}
//*************************************************************************
/// From other string, position, length.
///\param other The other string.

View File

@ -79,6 +79,16 @@ namespace etl
this->assign(other.begin(), other.end());
}
//*************************************************************************
/// From other iu16string.
///\param other The other iu16string.
//*************************************************************************
u16string(const etl::iu16string& other)
: iu16string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->assign(other.begin(), other.end());
}
//*************************************************************************
/// From other string, position, length.
///\param other The other string.

View File

@ -79,6 +79,16 @@ namespace etl
this->assign(other.begin(), other.end());
}
//*************************************************************************
/// From other iu32string.
///\param other The other iu32string.
//*************************************************************************
u32string(const etl::iu32string& other)
: iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->assign(other.begin(), other.end());
}
//*************************************************************************
/// From other string, position, length.
///\param other The other string.

View File

@ -79,6 +79,16 @@ namespace etl
wstring::assign(other.begin(), other.end());
}
//*************************************************************************
/// From other iwstring.
///\param other The other iwstring.
//*************************************************************************
wstring(const etl::iwstring& other)
: iwstring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->assign(other.begin(), other.end());
}
//*************************************************************************
/// From other string, position, length.