This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of CD1 status.
Section: 188.8.131.52.2 [facet.num.put.members] Status: CD1 Submitter: Martin Sebor Opened: 2002-03-12 Last modified: 2016-02-10
Priority: Not Prioritized
View all issues with CD1 status.
iter_type put (iter_type out, ios_base& str, char_type fill, bool val) const; ... 1 Returns: do_put (out, str, fill, val).
AFAICS, the behavior of do_put (..., bool) is not documented anywhere, however, 184.108.40.206.2, p23:
iter_type put (iter_type out, ios_base& str, char_type fill, bool val) const;
Effects: If (str.flags() & ios_base::boolalpha) == 0 then do out = do_put(out, str, fill, (int)val) Otherwise dostring_type s = val ? use_facet<ctype<charT> >(loc).truename() : use_facet<ctype<charT> >(loc).falsename();
and then insert the characters of s into out. out.
This means that the bool overload of do_put() will never be called, which contradicts the first paragraph. Perhaps the declaration should read do_put(), and not put()?
Note also that there is no Returns clause for this function, which should probably be corrected, just as should the second occurrence of "out." in the text.
I think the least invasive change to fix it would be something like the following:
In 220.127.116.11.3 [facet.num.put.virtuals], just above paragraph 1, remove the bool overload.
In 18.104.22.168.3 [facet.num.put.virtuals], p23, make the following changes
Replace put() with do_put() in the declaration of the member function.
Change the Effects clause to a Returns clause (to avoid the requirement to call do_put(..., int) from do_put (..., bool)) like so:
23 Returns: If (str.flags() & ios_base::boolalpha) == 0 then do_put (out, str, fill, (long)val) Otherwise the function obtains a string s as if bystring_type s = val ? use_facet<ctype<charT> >(loc).truename() : use_facet<ctype<charT> >(loc).falsename();
and then inserts each character c of s into out via *out++ = c and returns out.
This fixes a couple of obvious typos, and also fixes what appears to be a requirement of gratuitous inefficiency.