Title
adjustfield lacks default value
Status
nad
Section
[basic.ios.cons]
Submitter
Angelika Langer

Created on 1999-05-12.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

This is not a defect. It is deliberate that the default is no bits set. Consider Arabic or Hebrew, for example. See [facet.num.put.virtuals] paragraph 19, Table 61 - Fill padding.

Date: 1999-05-12.00:00:00

There is no initial value for the adjustfield defined, although many people believe that the default adjustment were right. This is a common misunderstanding. The standard only defines that, if no adjustment is specified, all the predefined inserters must add fill characters before the actual value, which is "as if" the right flag were set. The flag itself need not be set.

When you implement a user-defined inserter you cannot rely on right being the default setting for the adjustfield. Instead, you must be prepared to find none of the flags set and must keep in mind that in this case you should make your inserter behave "as if" the right flag were set. This is surprising to many people and complicates matters more than necessary.

Unless there is a good reason why the adjustfield should not be initialized I would suggest to give it the default value that everybody expects anyway.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1675
1999-05-12 00:00:00admincreate