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

no operator "+" matches these operands #14

Closed
rafrr opened this issue Jun 26, 2020 · 2 comments
Closed

no operator "+" matches these operands #14

rafrr opened this issue Jun 26, 2020 · 2 comments

Comments

@rafrr
Copy link

rafrr commented Jun 26, 2020

error: no operator "+" matches these operands

code: imgur

@rafrr rafrr changed the title std::filesystem error std::function error Jun 26, 2020
@rafrr rafrr changed the title std::function error no operator "+" matches these operands Jun 27, 2020
@AirGuanZ
Copy link
Owner

std::filesystem::path::u8string() returns an object of type std::string, so it should be ok to use operator+ to cat a const char* with std::string... I'm not sure why this ce happens. Maybe it's caused by compiler config. Could you please setup a new project and test the following code?

#include <iostream>
#include <filesystem>

int main()
{
    std::cout << ("test output" + std::filesystem::current_path().u8string() + "  test output") << std::endl;
}

@rafrr
Copy link
Author

rafrr commented Jun 27, 2020

Okay thanks for help, I had to change only C++ Language standard to ISO C++ 17 standard(std:c++17)

@rafrr rafrr closed this as completed Jun 27, 2020
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