-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implicit convertion to IntPtr from SafeHandle #12
Comments
I hadn't considered that approach, but I like it. Let me look at what would break if I refactored everything that way. |
Turned out it wasn't so hard. Thanks for the suggestion. Code has been updated to make that operator explicit and I've updated affected functions. |
Why not removing cast as .NET framework does. |
Well, basically because I'm lazy and it would entail too many changes. Sorry. |
… minimize unintended conversions (#12) and updated all affected functions, including fixing those affected by unintended consequences.
If you remove implicit cast it is already a breaking change. |
I don't think this is a good idea to have such implicit conversion.
It may lead to hard finding bugs.
The better option is to use SafeHandle instead of IntPtr.
Vanara/Core/InteropServices/GenericSafeHandle.cs
Line 41 in b9f2b15
The text was updated successfully, but these errors were encountered: