diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-05-09 14:43:00 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-05-09 16:43:51 +0300 |
commit | fe05dd0611cfc2929a7fdec04ca5948bccf0233b (patch) | |
tree | 96eaf0269ca842d4d0c4682734285bbc69edf7b5 /src/util | |
parent | 376294cde6b1588cb17055d8fde567eaf5848c3c (diff) |
util: Enhance bilingual_str
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/translation.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/util/translation.h b/src/util/translation.h index 45595405e7..dd60560168 100644 --- a/src/util/translation.h +++ b/src/util/translation.h @@ -16,13 +16,19 @@ struct bilingual_str { std::string original; std::string translated; + + bilingual_str& operator+=(const bilingual_str& rhs) + { + original += rhs.original; + translated += rhs.translated; + return *this; + } }; -inline bilingual_str operator+(const bilingual_str& lhs, const bilingual_str& rhs) +inline bilingual_str operator+(bilingual_str lhs, const bilingual_str& rhs) { - return bilingual_str{ - lhs.original + rhs.original, - lhs.translated + rhs.translated}; + lhs += rhs; + return lhs; } /** Mark a bilingual_str as untranslated */ |