]> granicus.if.org Git - icu/commitdiff
ICU-13644 Replying to review feedback. Changing enum methods on NumberFormatter to...
authorShane Carr <shane@unicode.org>
Wed, 2 May 2018 03:49:35 +0000 (03:49 +0000)
committerShane Carr <shane@unicode.org>
Wed, 2 May 2018 03:49:35 +0000 (03:49 +0000)
X-SVN-Rev: 41304

icu4c/source/i18n/number_fluent.cpp
icu4c/source/i18n/unicode/numberformatter.h

index c92c6bd0be72e3ba75eb620bf1407d923bb9b625..cea4125ae10023a860dfedaa90a1f7d32cbd1558 100644 (file)
@@ -86,34 +86,34 @@ Derived NumberFormatterSettings<Derived>::perUnit(const icu::MeasureUnit& perUni
 
 template<typename Derived>
 Derived NumberFormatterSettings<Derived>::perUnit(const icu::MeasureUnit& perUnit)&& {
-    Derived copy(*this);
+    Derived move(std::move(*this));
     // See comments above about slicing.
-    copy.fMacros.perUnit = perUnit;
-    return copy;
+    move.fMacros.perUnit = perUnit;
+    return move;
 }
 
 template<typename Derived>
 Derived NumberFormatterSettings<Derived>::adoptPerUnit(icu::MeasureUnit* perUnit) const& {
-    Derived move(std::move(*this));
+    Derived copy(*this);
     // See comments above about slicing and ownership.
     if (perUnit != nullptr) {
         // TODO: On nullptr, reset to default value?
-        move.fMacros.perUnit = std::move(*perUnit);
+        copy.fMacros.perUnit = std::move(*perUnit);
         delete perUnit;
     }
-    return move;
+    return copy;
 }
 
 template<typename Derived>
 Derived NumberFormatterSettings<Derived>::adoptPerUnit(icu::MeasureUnit* perUnit)&& {
-    Derived copy(*this);
+    Derived move(std::move(*this));
     // See comments above about slicing and ownership.
     if (perUnit != nullptr) {
         // TODO: On nullptr, reset to default value?
-        copy.fMacros.perUnit = std::move(*perUnit);
+        move.fMacros.perUnit = std::move(*perUnit);
         delete perUnit;
     }
-    return copy;
+    return move;
 }
 
 template<typename Derived>
@@ -133,7 +133,7 @@ Derived NumberFormatterSettings<Derived>::rounding(const Rounder& rounder)&& {
 }
 
 template<typename Derived>
-Derived NumberFormatterSettings<Derived>::grouping(const UGroupingStrategy& strategy) const& {
+Derived NumberFormatterSettings<Derived>::grouping(UGroupingStrategy strategy) const& {
     Derived copy(*this);
     // NOTE: This is slightly different than how the setting is stored in Java
     // because we want to put it on the stack.
@@ -142,7 +142,7 @@ Derived NumberFormatterSettings<Derived>::grouping(const UGroupingStrategy& stra
 }
 
 template<typename Derived>
-Derived NumberFormatterSettings<Derived>::grouping(const UGroupingStrategy& strategy)&& {
+Derived NumberFormatterSettings<Derived>::grouping(UGroupingStrategy strategy)&& {
     Derived move(std::move(*this));
     move.fMacros.grouper = Grouper::forStrategy(strategy);
     return move;
@@ -191,42 +191,42 @@ Derived NumberFormatterSettings<Derived>::adoptSymbols(NumberingSystem* ns)&& {
 }
 
 template<typename Derived>
-Derived NumberFormatterSettings<Derived>::unitWidth(const UNumberUnitWidth& width) const& {
+Derived NumberFormatterSettings<Derived>::unitWidth(UNumberUnitWidth width) const& {
     Derived copy(*this);
     copy.fMacros.unitWidth = width;
     return copy;
 }
 
 template<typename Derived>
-Derived NumberFormatterSettings<Derived>::unitWidth(const UNumberUnitWidth& width)&& {
+Derived NumberFormatterSettings<Derived>::unitWidth(UNumberUnitWidth width)&& {
     Derived move(std::move(*this));
     move.fMacros.unitWidth = width;
     return move;
 }
 
 template<typename Derived>
-Derived NumberFormatterSettings<Derived>::sign(const UNumberSignDisplay& style) const& {
+Derived NumberFormatterSettings<Derived>::sign(UNumberSignDisplay style) const& {
     Derived copy(*this);
     copy.fMacros.sign = style;
     return copy;
 }
 
 template<typename Derived>
-Derived NumberFormatterSettings<Derived>::sign(const UNumberSignDisplay& style)&& {
+Derived NumberFormatterSettings<Derived>::sign(UNumberSignDisplay style)&& {
     Derived move(std::move(*this));
     move.fMacros.sign = style;
     return move;
 }
 
 template<typename Derived>
-Derived NumberFormatterSettings<Derived>::decimal(const UNumberDecimalSeparatorDisplay& style) const& {
+Derived NumberFormatterSettings<Derived>::decimal(UNumberDecimalSeparatorDisplay style) const& {
     Derived copy(*this);
     copy.fMacros.decimal = style;
     return copy;
 }
 
 template<typename Derived>
-Derived NumberFormatterSettings<Derived>::decimal(const UNumberDecimalSeparatorDisplay& style)&& {
+Derived NumberFormatterSettings<Derived>::decimal(UNumberDecimalSeparatorDisplay style)&& {
     Derived move(std::move(*this));
     move.fMacros.decimal = style;
     return move;
index 493051eb74f153886b3f6f573376e5cfd143a881..9176ffaf95440ea3e34719f5acd53e3194e0601e 100644 (file)
@@ -1671,7 +1671,7 @@ class U_I18N_API NumberFormatterSettings {
      * @return The fluent chain.
      * @draft ICU 61
      */
-    Derived grouping(const UGroupingStrategy &strategy) const &;
+    Derived grouping(UGroupingStrategy strategy) const &;
 
     /**
      * Overload of grouping() for use on an rvalue reference.
@@ -1683,7 +1683,7 @@ class U_I18N_API NumberFormatterSettings {
      * @provisional This API might change or be removed in a future release.
      * @draft ICU 62
      */
-    Derived grouping(const UGroupingStrategy& strategy) &&;
+    Derived grouping(UGroupingStrategy strategy) &&;
 
     /**
      * Specifies the minimum and maximum number of digits to render before the decimal mark.
@@ -1846,7 +1846,7 @@ class U_I18N_API NumberFormatterSettings {
      * @see UNumberUnitWidth
      * @draft ICU 60
      */
-    Derived unitWidth(const UNumberUnitWidth &width) const &;
+    Derived unitWidth(UNumberUnitWidth width) const &;
 
     /**
      * Overload of unitWidth() for use on an rvalue reference.
@@ -1857,7 +1857,7 @@ class U_I18N_API NumberFormatterSettings {
      * @see #unitWidth
      * @draft ICU 62
      */
-    Derived unitWidth(const UNumberUnitWidth &width) &&;
+    Derived unitWidth(UNumberUnitWidth width) &&;
 
     /**
      * Sets the plus/minus sign display strategy. Most common values:
@@ -1885,7 +1885,7 @@ class U_I18N_API NumberFormatterSettings {
      * @provisional This API might change or be removed in a future release.
      * @draft ICU 60
      */
-    Derived sign(const UNumberSignDisplay &style) const &;
+    Derived sign(UNumberSignDisplay style) const &;
 
     /**
      * Overload of sign() for use on an rvalue reference.
@@ -1896,7 +1896,7 @@ class U_I18N_API NumberFormatterSettings {
      * @see #sign
      * @draft ICU 62
      */
-    Derived sign(const UNumberSignDisplay &style) &&;
+    Derived sign(UNumberSignDisplay style) &&;
 
     /**
      * Sets the decimal separator display strategy. This affects integer numbers with no fraction part. Most common
@@ -1924,7 +1924,7 @@ class U_I18N_API NumberFormatterSettings {
      * @provisional This API might change or be removed in a future release.
      * @draft ICU 60
      */
-    Derived decimal(const UNumberDecimalSeparatorDisplay &style) const &;
+    Derived decimal(UNumberDecimalSeparatorDisplay style) const &;
 
     /**
      * Overload of decimal() for use on an rvalue reference.
@@ -1935,7 +1935,7 @@ class U_I18N_API NumberFormatterSettings {
      * @see #decimal
      * @draft ICU 62
      */
-    Derived decimal(const UNumberDecimalSeparatorDisplay &style) &&;
+    Derived decimal(UNumberDecimalSeparatorDisplay style) &&;
 
     /**
      * Sets a scale (multiplier) to be used to scale the number by an arbitrary amount before formatting.