NoSkillPureAndy
✅ Writing a scuffed way to use an "assignment" (=) operator
Obviously, there's no such thing as an assignment operator. I'd like to find some way around that.
I have a class that looks something like this:
I'd like to be able to assign values to this:
Is there any hacky, bodged, whatever way of doing this? I can't do it like this, obviously, because operators are static:
Any ideas are appreciated, thanks!
21 replies
How would I check if a generic type is unmanaged, then pass it to a method with where T ; unmanaged?
I have a method that needs to call different methods based on whether T is managed or not. I'm not sure how to check if T is unmanaged, and also tell the compiler that it can use it in the method with the unmanaged constraint.
5 replies