-
Notifications
You must be signed in to change notification settings - Fork 310
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
Add feature macro to allow implicit cast of UniqueHandle to hpp handles #1731
Comments
They could create a constructor like this at Line 871 in 846ac99
|
If the maintainers agree I can make a PR |
There is already such constructor. And this isn't the same as an implicit convertion operator anyway. Line 886 in 846ac99
|
But this is an explicit constructor |
Thanks for your request. |
UniqueHandles are a great way of ensuring automatic resource destruction and cleaner code. However the constant need to run .get() or operator* to retrieve the underlying handle for CreateInfo structures or vulkan calls makes them more cumbersome to use than normal handles. I feel that trying to mimic the std::unique_ptr API here doesn't make much sense, considering that handles are most often used in such a manner compared to e.g running member functions with operator->. So I feel it would be useful to add new feature macro, for example VULKAN_HPP_SMART_HANDLE_IMPLICIT_CAST, that will define an implicit convertion operator to the underlying handle
The text was updated successfully, but these errors were encountered: