Topic: N2369 Defect: wstring_convert inconsistensies


Author: bop@gmb.dk ("Bo Persson")
Date: Mon, 27 Aug 2007 20:36:21 GMT
Raw View
Section 22.1.3.2.2 [conversions.string]

1. A small oversight: The class has no public members at all!

Add a public: after the opening brace!


2. In the synopsis the (really) private data members are marked
"exposition only", but in paragraph 4 it says that a class object
stores these named members. Are they required, or not?


3. Paragraph 3 says that the Codecvt template parameter shall meet the
requirements of std::codecvt, even though std::codecvt itself cannot
be used (because of a protected destructor).

How are we going to explain this code to beginning programmers?

   template<class I, class E, class S>
   struct codecvt : std::codecvt<I, E, S>
   {
      ~codecvt()
      { }
   };

   void main()
   {
      std::wstring_convert<codecvt<wchar_t, char, std::mbstate_t> >
compiles_ok;

      std::wstring_convert<std::codecvt<wchar_t, char, std::mbstate_t>
 >   not_ok;

   }



Bo Persson


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]