Core/String: Fix movement leaving a null shared string

This commit is contained in:
Jérôme Leclercq
2017-11-22 09:27:23 +01:00
parent 046926e4d4
commit 9c9b9ed49f
3 changed files with 7 additions and 7 deletions

View File

@@ -41,7 +41,7 @@ namespace Nz
String(const char* string, std::size_t length);
String(const std::string& string);
String(const String& string) = default;
String(String&& string) noexcept = default;
inline String(String&& string) noexcept;
~String() = default;
String& Append(char character);

View File

@@ -7,12 +7,11 @@
namespace Nz
{
/*!
* \ingroup core
* \brief Constructs a String object with a shared string by move semantic
*
* \param sharedString Shared string to move into this
*/
inline Nz::String::String(String&& string) noexcept :
m_sharedString(std::move(string.m_sharedString))
{
string.m_sharedString = GetEmptyString();
}
inline String::String(std::shared_ptr<SharedString>&& sharedString) :
m_sharedString(std::move(sharedString))