http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50714

--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-14 
08:51:08 UTC ---
I wonder if another alternative would have been, also for better error
reporting to the user, to do sth like

      explicit
      codecvt(size_t __refs = 0) = deleted;

instead of providing a default implementation that likely isn't correct.
(or instead of = deleted just do not provide an implementation so you
get a link error).

The idea is that the user would need to provide a specialization of
that constructor.

Or, why not, for codecvt_byname, use the codecvt(__c_local, size_t)
constructor instead, with a "NULL" locale, and omit the
this->_S_destroy_c_locale(this->_M_c_locale_codecvt) in codecvt_byname.

It's also odd to not destroy or initialize(!) the locale in codecvt_byname
if the requested locale is "C" or "POSIX".  Thus I suppose using

      explicit
      codecvt_byname(const char* __s, size_t __refs = 0)
      : codecvt<_InternT, _ExternT, _StateT>("C", __refs)

(well, with a proper __c_locale object for "C") would be even better?

Reply via email to