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:
-
Why is behaviour for char types not defined by the standard?
-
Does VS2017 prohibit this for technical reasons, or simply to prevent nonstandard usage?
Aucun commentaire:
Enregistrer un commentaire