Title
bitset::to_string could be simplified
Status
c++11
Section
[template.bitset]
Submitter
Alisdair Meredith

Created on 2009-05-09.00:00:00 last changed 161 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

  1. In [template.bitset]/1 (class bitset) ammend:

    template <class charT = char,
                class traits = char_traits<charT>,
                class Allocator = allocator<charT>> 
      basic_string<charT, traits, Allocator>
      to_string(charT zero = charT('0'), charT one = charT('1')) const;
    template <class charT, class traits> 
      basic_string<charT, traits, allocator<charT> > to_string() const; 
    template <class charT> 
      basic_string<charT, char_traits<charT>, allocator<charT> > to_string() const; 
    basic_string<char, char_traits<char>, allocator<char> > to_string() const;
    
  2. In [bitset.members] prior to p35 ammend:

    template <class charT = char,
                class traits = char_traits<charT>,
                class Allocator = allocator<charT>> 
      basic_string<charT, traits, Allocator>
      to_string(charT zero = charT('0'), charT one = charT('1')) const;
    
  3. Strike [bitset.members] paragraphs 37 -> 39 (including signature above 37)
Date: 2010-10-21.18:28:33

[ 2009-10 post-Santa Cruz: ]

Move to Tentatively Ready.

Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

Move to Open, and look at the issue again after 853 has been accepted. We further recommend this be deferred until after the next Committee Draft.

Date: 2009-05-09.00:00:00

In 853 our resolution is changing the signature by adding two defaulting arguments to 3 calls. In principle, this means that ABI breakage is not an issue, while API is preserved.

With that observation, it would be very nice to use the new ability to supply default template parameters to function templates to collapse all 3 signatures into 1. In that spirit, this issue offers an alternative resolution than that of 853.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg791
2010-10-21 18:28:33adminsetmessages: + msg790
2010-10-21 18:28:33adminsetmessages: + msg789
2009-05-09 00:00:00admincreate