DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

HLSL enum types do not conform to intended C++ behavior

Open tex3d opened this issue 3 years ago • 0 comments

The unscoped enum type has differences in behavior in HLSL from the C++ behavior that should be rectified. The primary difference is that it preserves the enum type for binary operator expression results rather than converting to int first and resulting in an int type for the expression.

Additionally, enum struct has unintended differences in behavior from enum class because, other than scoping, it's treated the same way as the unscoped enum type, allowing operations without casting that should require explicit casting.

tex3d avatar Jun 02 '22 21:06 tex3d