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>
}
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.
}
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;
}
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;
* @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.
* @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.
* @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.
* @see #unitWidth
* @draft ICU 62
*/
- Derived unitWidth(const UNumberUnitWidth &width) &&;
+ Derived unitWidth(UNumberUnitWidth width) &&;
/**
* Sets the plus/minus sign display strategy. Most common values:
* @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.
* @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
* @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.
* @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.