Skip to content

Commit 05f8d93

Browse files
committed
impr: Add proper move constructors to UnlocalizedString
1 parent 8f277f0 commit 05f8d93

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/libimhex/include/hex/api/localization_manager.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ EXPORT_MODULE namespace hex {
102102
UnlocalizedString(const std::string &string) : m_unlocalizedString(string) { }
103103
UnlocalizedString(const char *string) : m_unlocalizedString(string) { }
104104
UnlocalizedString(const Lang& arg) = delete;
105+
UnlocalizedString(std::string &&string) : m_unlocalizedString(std::move(string)) { }
106+
UnlocalizedString(UnlocalizedString &&) = default;
107+
UnlocalizedString(const UnlocalizedString &) = default;
108+
109+
UnlocalizedString &operator=(const UnlocalizedString &) = default;
110+
UnlocalizedString &operator=(UnlocalizedString &&) = default;
111+
UnlocalizedString &operator=(const std::string &string) { m_unlocalizedString = string; return *this; }
112+
UnlocalizedString &operator=(std::string &&string) { m_unlocalizedString = std::move(string); return *this; }
105113

106114
[[nodiscard]] operator std::string() const {
107115
return m_unlocalizedString;

0 commit comments

Comments
 (0)