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

improve const correctness of disk I/O code #7644

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

arvidn
Copy link
Owner

@arvidn arvidn commented Mar 10, 2024

by making readwrite() a template that can work with both span and span.

@glassez
Copy link
Contributor

glassez commented Mar 11, 2024

Isn't span<char const> constructible from span<char>?

@arvidn
Copy link
Owner Author

arvidn commented Mar 11, 2024

I believe it is. the issue here is that it's being passed to a function, and that function then passes it back into a callback. So it's being "laundered" by the readwrite() function signature. By making it a template, it can either char const or char and the callback takes the same type

@glassez
Copy link
Contributor

glassez commented Mar 11, 2024

the issue here is that it's being passed to a function, and that function then passes it back into a callback.

Got it.

…mplate that can work with both span<char> and span<char const>.
@arvidn arvidn merged commit 3c18f6d into master Mar 11, 2024
42 of 43 checks passed
@arvidn arvidn deleted the disk-const-correctness branch March 11, 2024 15:47
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.

2 participants