Question about a warning message
Jonathan Wakely
jwakely.gcc@gmail.com
Fri Sep 7 08:03:00 GMT 2018
On Thu, 6 Sep 2018 at 20:30, Juan Cabrera <jjcp.91@gmail.com> wrote:
>
> Hello!
>
> Thank you for your answers.
> I'm aware that you can cast anything into an `enum class` but I
> thought that casting a non valid enum-class value into an enum-class
> was itself "wrong" or "unedfined behavior" or something like that :D.
No, because for an enum class all values of the underlying type are
valid values of the enum.
The compiler is right to warn.
More information about the Gcc-help
mailing list