Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofCD1 status.

695. ctype<char>::classic_table() not accessible

Section: 28.3.4.2.4[facet.ctype.special]Status:CD1Submitter: Martin SeborOpened: 2007-06-22Last modified: 2016-01-28

Priority:Not Prioritized

View all issues withCD1 status.

Discussion:

Thectype<char>::classic_table() static memberfunction returns a pointer to an array of constctype_base::mask objects (enums) that containsctype<char>::table_size elements. The tabledescribes the properties of the character set in the "C" locale (i.e.,whether a character at an index given by its value is alpha, digit,punct, etc.), and is typically used to initialize thectype<char> facet in the classic "C" locale (theprotectedctype<char> member functiontable() then returns the same value asclassic_table()).

However, whilectype<char>::table_size (the size ofthe table) is a public static const member of thectype<char> specialization, theclassic_table() static member function is protected. Thatmakes getting at the classic data less than convenient (i.e., one hasto create a whole derived class just to get at the masks array). Itmakes little sense to expose the size of the table in the publicinterface while making the table itself protected, especially when thetable is a constant object.

The same argument can be made for the non-static protected memberfunctiontable().

Proposed resolution:

Make thectype<char>::classic_table() andctype<char>::table() member functions public bymoving their declarations into the public section of the definition ofspecialization in 28.3.4.2.4[facet.ctype.special] as shown below:

  static locale::id id;  static const size_t table_size = IMPLEMENTATION_DEFINED;protected:  const mask* table() const throw();  static const mask* classic_table() throw();protected:~ctype(); // virtualvirtual char do_toupper(char c) const;

[8]ページ先頭

©2009-2026 Movatter.jp