Title
Standard code conversion facets underspecified
Status
c++14
Section
[depr.locale.stdcvt]
Submitter
Beman Dawes

Created on 2012-12-30.00:00:00 last changed 123 months ago

Messages

Date: 2013-04-18.22:58:13

Proposed resolution:

In [locale.stdcvt] paragraph 2, Header codecvt synopsis:

template<class Elem, unsigned long Maxcode = 0x10ffff,
  codecvt_mode Mode = (codecvt_mode)0>
class codecvt_utf8
  : public codecvt<Elem, char, mbstate_t> {
  // unspecified
public:
  explicit codecvt_utf8(size_t refs = 0);
  ~codecvt_utf8();
  };

template<class Elem, unsigned long Maxcode = 0x10ffff,
  codecvt_mode Mode = (codecvt_mode)0>
class codecvt_utf16
  : public codecvt<Elem, char, mbstate_t> {
  // unspecified
public:
  explicit codecvt_utf16(size_t refs = 0);
  ~codecvt_utf16();
  };

template<class Elem, unsigned long Maxcode = 0x10ffff,
  codecvt_mode Mode = (codecvt_mode)0>
class codecvt_utf8_utf16
  : public codecvt<Elem, char, mbstate_t> {
  // unspecified
public:
  explicit codecvt_utf8_utf16(size_t refs = 0);
  ~codecvt_utf8_utf16();
  };
Date: 2013-04-15.00:00:00

[ 2013-04-18, Bristol ]

Date: 2013-03-15.00:00:00

[ 2013-03-15 Issues Teleconference ]

Moved to Review.

There was concern about the unspecified semantics - but that matches what is done in codecvt.

Jonathan: Should these constructor/destructors be public? Proposed wording is private. Base class constructor is public.

Howard noted that other facets do not have specified constructors.

Alisdair noted that this whole section was new in C++11.

Howard suggested looking at section [locale.facet]p2/p3 for more info.

Date: 2012-12-30.00:00:00

The only specification for the non-inherited members of classes codecvt_utf8, codecvt_utf16, and codecvt_utf8_utf16 is a comment line in the synopsis that says // unspecified. There is no further indication of functionality, so a user does not know if one of these classes can be constructed or destroyed.

The proposed resolution adds a constructor that mimics the class codecvt constructor, and also adds a destructor. Following the practice of class codecvt, the semantics are not specified.

The only existing implementation I could find was libc++, and it does supply the proposed constructor and destructor for each of the three classes.

History
Date User Action Args
2014-02-20 13:20:35adminsetstatus: wp -> c++14
2013-04-25 19:07:07adminsetstatus: voting -> wp
2013-04-19 21:44:50adminsetstatus: ready -> voting
2013-04-18 22:58:13adminsetmessages: + msg6466
2013-04-18 22:58:13adminsetstatus: review -> ready
2013-03-18 14:33:00adminsetmessages: + msg6438
2013-03-18 13:02:36adminsetstatus: new -> review
2013-01-11 19:35:06adminsetmessages: + msg6309
2012-12-30 00:00:00admincreate