From fe05dd0611cfc2929a7fdec04ca5948bccf0233b Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 9 May 2020 14:43:00 +0300 Subject: util: Enhance bilingual_str --- src/util/translation.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/util') 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 */ -- cgit v1.2.3