On 16/02/16 10:51 +0000, Jonathan Wakely wrote:
Given that there are dozens of those initializers it might be more
readable to do:

static const char none = -1;
const char HEX2DEC[256] = { none, none, none, ..... }

For the avoidance of doubt, this is not an error in C++11.

Narrowing conversions are only erorrs when they appear inside a
braced-init-list. So 'none' is initialized to (char)-1 without error,
then the elements of the HEX2DEC array are initialized from char
values that need no conversion, so also without error.

The original code required -1 to be converted to char inside the
braqced-init-list for HEX2DEC.
--
devel mailing list
devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org

Reply via email to