-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support Visual Studio 2017 #446
Comments
Hi @qingfengxia , could you please paste the compilation error from your side? Thanks! |
cancel_async exmple has error
Severity Code Description File Line Suppression State I had some moderate trial (like make es5 code work in older browser), it does not work, it seems the compiler lack the feature to support |
Yes, I suspect it's an issue with MS compiler to detect the return value (type of the optional) that should be done correctly with auto-deduction. Could you please do the following change and report to me if the problem is still there? // original code
else {
p.object.set_value(cancel ? std::nullopt : std::make_optional(f(args...)));
}
// change to the following
else {
if(cancel) {
p.object.set_value(std::nullopt);
}
else {
p.object.set_value(f(args...));
}
}
// or you can do the following
else {
std::optional<T> res;
if(!cancel) {
res = f(args...);
}
p.object.set_value(std::move(res));
} |
using your first solution, the std::opitonal error has gone, now get into second error message. Severity Code Description File Line Suppression State I think visual c++ 14.x, does not support ==============================
FAILED: examples/CMakeFiles/parallel_data_pipeline.dir/parallel_data_pipeline.cpp |
Do you have a C++17 compiler in your MSVC version? This might be the best way to get rid of |
we have no chance to upgrade visual studio, I have solved the problem. |
Reason: visual studio 2017 (16.35 latest) still does not support Solution from hints https://stackoverflow.com/questions/26421104/how-do-i-enable-if-a-class-with-variadic-template-arguments, Here is my template function specialization for template ellipsis
similarly problem and solution for: executor.hpp 26xx I can not make PR, so please fix this by change several lines. Although I have not all examples compiled, but seems I have most features, so I can get started. |
except for data_pipeline , all other example and unittest can be compiled. |
@qingfengxia thanks! would you be willing to create a pull request? I guess you can skip the data pipeline compilation errors by not including its header in your application. |
The newest version has removed this optional support in async task - should be no problem. Feel free to open another issue if the problem is still there. |
Some example can not be compiled, like using API
named_async()
p.object.set_value(cancel ? std::nullopt : std::make_optional(f(args...)));
I wonder if it is possible to replace the
std::make_optional(f(args...))
with conditonal compilingcan not correlate with visual studio release version with taskflow requirement of "Microsoft Visual Studio at least v19.27 with /std:c++17"
The text was updated successfully, but these errors were encountered: