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

Map entire file by default. #28

Merged
merged 1 commit into from
Oct 25, 2018
Merged

Conversation

jdarpinian
Copy link
Contributor

No description provided.

@vimpunk
Copy link
Owner

vimpunk commented Oct 24, 2018

@jdarpinian That's a great idea, thanks! This is something I wanted to do as well, but I hit a wall when trying to extend the idea to the map member functions, which take a std::error_code& as their last argument. In retrospect, I think it should have been the first argument, or even the return value--though this would have broken symmetry with APIs that return something else and thus need error code to be an out parameter. But I digress.

Can you please apply the same changes to basic_shared_mmap as well (preferably as an amended commit)?

@vimpunk
Copy link
Owner

vimpunk commented Oct 24, 2018

Just realized that the mapping functions could be overloaded to just map(path|handle, error_code&) to provide the same default behavior of mapping the entire file. Would you be willing to implement these as well? It's ok if not, I can patch it after merging your PR.

@jdarpinian
Copy link
Contributor Author

Done!

@vimpunk
Copy link
Owner

vimpunk commented Oct 25, 2018

Great work, thank you so much!

@vimpunk vimpunk merged commit 43ee283 into vimpunk:master Oct 25, 2018
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

2 participants