Skip to content
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

Template parameter in ScopedBuffer::Ptr is no more than an obscured cast, consider removal #3025

Closed
rwalker-apple opened this issue Oct 2, 2020 · 1 comment · Fixed by #3026
Labels
bug Something isn't working

Comments

@rwalker-apple
Copy link
Contributor

I agree with Boris, the current implementation strikes me as type-unsafe and we should be able to fix it without increasing code size.

I would suggest removing the template parameter from Ptr<> in this initial PR, that's really just hiding a typecast under a less obvious syntax now. Potentially unsafe casts are the last thing we want to hide in a benign-looking accessor function.

Originally posted by @mspang in #2987 (comment)

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.57. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the bug Something isn't working label Oct 2, 2020
@rwalker-apple rwalker-apple changed the title Template parameter in ScopedBuffer is no more than an obscured cast, should be removed Template parameter in ScopedBuffer::Ptr is no more than an obscured cast, consider removal Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant