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

Issue with GCC 4.8 #39

Open
amallia opened this issue Feb 2, 2019 · 4 comments
Open

Issue with GCC 4.8 #39

amallia opened this issue Feb 2, 2019 · 4 comments

Comments

@amallia
Copy link
Contributor

amallia commented Feb 2, 2019

I had this isse with GCC 4.8 (does not happen with newer compilers).
filename is just an std::string (not a reference)

mio::mmap_source m(filename);
error: no matching function for call to ‘mio::basic_mmap<(mio::access_mode)0, char>::basic_mmap(const string&)’
     mio::mmap_source m(filename);
                                ^

I have solved it using:

mio::mmap_source m;
std::error_code error;
m.map(filename, error);
@vimpunk
Copy link
Owner

vimpunk commented Feb 2, 2019

Hmm, this is strange. Admittedly I haven't tested on older toolchains. Thanks for reporting, I'll look into it in a bit.

@vimpunk
Copy link
Owner

vimpunk commented Feb 5, 2019

Apologies, had to go out of town for a few days.

So looking at it now I honestly don't know why that errors out as the constructor does the exact same thing as your solution. Do you have any ideas? I was thinking that GCC 4.8 might not fully support C++11, but it looks like it does. However, it looks like its std::string implementation is out of date, if this stackoverflow comment can be trusted. Could that explain it? The string API should be the same, I think.

@amallia
Copy link
Contributor Author

amallia commented Feb 5, 2019

Apologies, had to go out of town for a few days.

Not a big issue, since there is an alternative solution. I just wanted to open an issue to make other users aware of this.

So looking at it now I honestly don't know why that errors out as the constructor does the exact same thing as your solution. Do you have any ideas? I was thinking that GCC 4.8 might not fully support C++11, but it looks like it does. However, it looks like its std::string implementation is out of date, if this stackoverflow comment can be trusted. Could that explain it? The string API should be the same, I think.

Not sure. I can give it a look if you care about supporting GCC 4.8

@vimpunk
Copy link
Owner

vimpunk commented Feb 6, 2019

@amallia It's not a huge priority as I think most people who can use POSIX/Win mmap facilities will have access to the latest compilers. So only spend time on this if you personally care about GCC 4.8 support, I'd say :)

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

No branches or pull requests

2 participants