This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD status.

374. moneypunct::frac_digits returns int not unsigned

Section: 28.3.4.7.4.2 [locale.moneypunct.members], 28.3.4.7.4.3 [locale.moneypunct.virtuals] Status: NAD Submitter: Ray Lischner Opened: 2002-08-08 Last modified: 2016-01-28

Priority: Not Prioritized

View all issues with NAD status.

Discussion:

In section 28.3.4.7.4.2 [locale.moneypunct.members], frac_digits() returns type "int". This implies that frac_digits() might return a negative value, but a negative value is nonsensical. It should return "unsigned".

Similarly, in section 28.3.4.7.4.3 [locale.moneypunct.virtuals], do_frac_digits() should return "unsigned".

Proposed resolution:

Rationale:

Regardless of whether the return value is int or unsigned, it's always conceivable that frac_digits might return a nonsensical value. (Is 4294967295 really any better than -1?) The clients of moneypunct, the get and put facets, can and do perform range checks.