vendredi 5 janvier 2018

Undefined behaviour for

Section 29.6.1.1 of the C++11 standard restricts the UIntType argument to a <random> engine template to unsigned short and larger. Behaviour for other types - specifically unsigned char - is undefined.

While GCC (4.9.2, at least) accepts unsigned char, the VS2017 compiler errors out due to a static assert on the type.

My questions are:

  1. Why is behaviour for char types not defined by the standard?

  2. Does VS2017 prohibit this for technical reasons, or simply to prevent nonstandard usage?




Aucun commentaire:

Enregistrer un commentaire