Allow Bit-Shift by an uint
#9645
Unanswered
BoyBaykiller
asked this question in
General
Replies: 1 comment
-
Should be doable with extension operators when C# 14 is released in a couple months. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Today operator '<<' and '>>' can not be applied if the left hand side is any integer type and the right hand side is
uint
:Users are required to cast from uint to int. I am advocating for lifting this artifical restriction to avoid uneccessary casts. Just like #9635.
uint
is very popular when doing bitwise ops. Even more so in native code (relevant for porting to C#)One real-word example from BitArray:
index
must beuint
to get efficient codegen. When I create the mask I have to cast.Beta Was this translation helpful? Give feedback.
All reactions