Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3)

Unified Diff: i18n/currunit.cpp

Issue 342730043: [Abandoned] Adding move operators to MeasureUnit and subclasses. Base URL: svn+icussh://source.icu-project.org/repos/icu/branches/shane/numberformat4/icu4c/source/
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | i18n/measunit.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: i18n/currunit.cpp
===================================================================
--- i18n/currunit.cpp (revision 41097)
+++ i18n/currunit.cpp (working copy)
@@ -38,6 +38,10 @@
u_strcpy(isoCode, other.isoCode);
}
+// Call copy constructor from move constructor since there is nothing to move
+CurrencyUnit::CurrencyUnit(CurrencyUnit&& src) U_NOEXCEPT
+ : CurrencyUnit(static_cast<CurrencyUnit&>(src)) {}
+
CurrencyUnit::CurrencyUnit(const MeasureUnit& other, UErrorCode& ec) : MeasureUnit(other) {
// Make sure this is a currency.
// OK to hard-code the string because we are comparing against another hard-coded string.
@@ -67,6 +71,12 @@
return *this;
}
+// Call copy assignment from move assignment since there is nothing to move
+CurrencyUnit& CurrencyUnit::operator=(CurrencyUnit&& src) U_NOEXCEPT {
+ *this = static_cast<CurrencyUnit&>(src);
+ return *this;
+}
+
UObject* CurrencyUnit::clone() const {
return new CurrencyUnit(*this);
}
« no previous file with comments | « no previous file | i18n/measunit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b