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

[obj.lifetime] Use static_cast instead of C-style cast expression #5887

Closed
wants to merge 2 commits into from

Conversation

blackteahamburger
Copy link
Contributor

No description provided.

@Dani-Hub
Copy link
Member

Dani-Hub commented Oct 4, 2022

This doesn't work, because this wording is supposed to be valid for pointers to cv-char as well, and the static_cast cannot do this.

@blackteahamburger
Copy link
Contributor Author

blackteahamburger commented Oct 4, 2022

This doesn't work, because this wording is supposed to be valid for pointers to cv-char as well, and the static_cast cannot do this.

Fixed.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 8, 2022

@jwakely could you please take a look?

@tkoeppe tkoeppe requested a review from jwakely November 8, 2022 00:45
Copy link
Member

@jwakely jwakely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is editorial. I'm not sure what it means for [p,q) to denote a region of storage when they're different types, and especially not when p is a pointer to void. What is the sequence of elements between those pointers? How to you increment the start of the range to each the end of the range?

I would be OK with [(char*)p,(char*)p+sizeof(T)) but I don't think the suggested change is an improvement, and I think this might need an LWG issue.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 8, 2022

Thanks! So is even the status quo questionable then? Should I file an issue?

@jwakely
Copy link
Member

jwakely commented Nov 8, 2022

Yes please.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 8, 2022

Done. This is now being handled as an LWG issue.

@tkoeppe tkoeppe closed this Nov 8, 2022
@blackteahamburger blackteahamburger deleted the main-cast branch January 6, 2023 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants