A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue2507 below:

codecvt_mode should be a bitmask type

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

2507. codecvt_mode should be a bitmask type

Section: 99 [depr.locale.stdcvt] Status: New Submitter: Jonathan Wakely Opened: 2015-06-08 Last modified: 2017-04-22

Priority: 3

View all other issues in [depr.locale.stdcvt].

View all issues with New status.

Discussion:

The enumeration type codecvt_mode is effectively a bitmask type (16.3.3.3.3 [bitmask.types]) with three elements, but isn't defined as such.

This harms usability because bitmask types are required to work well with bitwise operators, but codecvt_mode doesn't have overloaded operators, making it very inconvenient to combine values:
std::codecvt_utf16<char32_t, 0x10FFFF,
  static_cast<std::codecvt_mode>(std::little_endian|std::generate_header)>
cvt;

The static_cast harms readability and should not be necessary.

I suggest that either codecvt_mode is specified to be a bitmask type, or as a minimal fix we provide an overloaded operator| that returns the right type.

Proposed resolution:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4