-
Notifications
You must be signed in to change notification settings - Fork 52
Fix issue #21 #58
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
Fix issue #21 #58
Conversation
|
This definitely doesn't fix accessing it in a const context, but it should already be downcasting the |
|
@wak-google Thank you for your PR, and sorry for not responding earlier to your question in the related ticket. Sadly this issue needs to be fixed without introducing an additional pointer into the storage, Eventually a well-placed and checked I can take an additional look at it in the upcoming days. |
|
@Naios yeah, I could just const cast instead. However, this doesn't change the size because it's a member of a union, not a struct. |
|
Yes, you are right. It looked in my diff as it was a struct. |
|
There is a smaller change |
|
I adapted your previous commit in a follow-up commit on top already (if this is also ok for you). Could you explain this a little bit further please? What point is missing here?
|
|
My concern was just in case something was accessing it in a non-const context. I believe all of the uses get cast back with const applied prior to calling the function, so it should be fine. |
|
The issue is in general that the view is non-const correct anymore like all view types are, |
|
Thank you for your contribution, I highly appreciate it! Well done. |
This makes it possible to use const functions in function_views by fixing constness when setting the data pointer to the function.