On 02.07.2019 21:15, Michael Van Canneyt wrote:
Don't forget to check the post of Ondrej.
Personally, I think using 'as' to convert an integer to an enum with
range
check is still the best approach. It does not require new intrinsics (far
too many of those already) and does what it says. To simply check if an
integer is a valid enum, I think 'is' would be equally suitable.
The latest patch in https://bugs.freepascal.org/view.php?id=33603
supports bot AS and IS operators. Yes, the first patch was only about
the AS-operator and the issue summary is about AS only as well. You know
- nobody is perfect and I didn't realize the IS-operator was suitable
there too in the very beginning. The mind&development progress can be
read from the ML thread.
Ondrej
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel