374. moneypunct::frac_digits returns int not unsigned

Section: [locale.moneypunct.members], [locale.moneypunct.virtuals] Status: NAD Submitter: Ray Lischner Opened: 2002-08-08 Last modified: 2016-02-10

Priority: Not Prioritized

View all issues with NAD status.


In section [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 [locale.moneypunct.virtuals], do_frac_digits() should return "unsigned".

Proposed resolution:


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.