By sathenzar,
Tagged with:
We rely on ads to keep creating quality content for you to enjoy for free.
Please support our site by disabling your ad blocker.
Continue without supporting us
If the prompt is still appearing, please disable any tools or services you are using that block internet ads (e.g. DNS Servers, tracking protection or privacy extensions).
Question
simplezz
Hi all,
I'm trying to pass a value constrained type to BitConverter.GetBytes, but c# only permits a struct constraint. For example:
The compiler understandably borks at this. Still I'd like to find a solution that avoids repetition and doesn't require writing multiple overloads for different primitives.Link to comment
https://www.neowin.net/forum/topic/1266054-bufferblockcopy-passing-generic-argument/Share on other sites
2 answers to this question
Recommended Posts