mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 17:01:16 +00:00
ICU-21215 Add default constructor to FormattedNumberRange
This commit is contained in:
parent
8cd025bb9c
commit
c12c5b5a4c
2 changed files with 12 additions and 0 deletions
|
@ -641,6 +641,15 @@ class U_I18N_API FormattedNumberRange : public UMemory, public FormattedValue {
|
|||
*/
|
||||
UNumberRangeIdentityResult getIdentityResult(UErrorCode& status) const;
|
||||
|
||||
#ifndef U_HIDE_DRAFT_API
|
||||
/**
|
||||
* Default constructor; makes an empty FormattedNumberRange.
|
||||
* @draft ICU 70
|
||||
*/
|
||||
FormattedNumberRange()
|
||||
: fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Copying not supported; use move constructor instead.
|
||||
*/
|
||||
|
|
|
@ -827,6 +827,9 @@ void NumberRangeFormatterTest::testCopyMove() {
|
|||
assertEquals("FormattedNumberRange move constructor", u"1,00–5,00 $US", result.toString(status));
|
||||
result = l1.formatFormattableRange(3, 6, status);
|
||||
assertEquals("FormattedNumberRange move assignment", u"3,00–6,00 $US", result.toString(status));
|
||||
FormattedNumberRange fnrdefault;
|
||||
fnrdefault.toString(status);
|
||||
status.expectErrorAndReset(U_INVALID_STATE_ERROR);
|
||||
}
|
||||
|
||||
void NumberRangeFormatterTest::toObject() {
|
||||
|
|
Loading…
Add table
Reference in a new issue