-
Notifications
You must be signed in to change notification settings - Fork 163
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
Regression: compilation failure in boost/gil/extension/dynamic_image/any_image.hpp #510
Comments
It's a breaking change, admittedly not very well documented. boost::gil::any_image<
boost::gil::gray8_image_t,
boost::gil::gray16_image_t,
boost::gil::rgb8_image_t> source; should work. No need for a MPL Sequence anymore since we have variadic template in C++11 (required for GIL since 1.68). |
Basically, as part of C++11 modernisation started in Boost 1.68, we've removed uses of MPL (replacing them with MP11) in Boost 1.72. I have updated our release notes to make the change clearer f3ba17f I did not know/or forgot about the Boost Cookbook. I think it is important piece of material and to keep it up to date. I will try to include it in my testing of GIL. Thanks @sdebionne for updating it. |
I've tried that and now GIL fails to substitute the apply_visitor: https://travis-ci.org/github/apolukhin/Boost-Cookbook/jobs/711455496#L2754 |
I think, I see the problem:
A dumb fix is auto apply_operation(Variant1&& arg1, Visitor&& op)
#if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
-auto apply_operation(Variant1&& arg1, Visitor&& op)
+auto apply_operation(Variant1&& arg1, Visitor op) or a less dumb auto apply_operation(Variant1&& arg1, Visitor&& op)
#if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
- -> typename Visitor::result_type
+ -> typename std::remove_reference<Visitor>::type::result_type @sdebionne What do you think? |
@mloskot Thank you for investigating this! It passed through the cracks unnoticed on my side too (std > c++11).
auto apply_operation(Variant1&& arg1, Visitor&& op)
#if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
- -> typename Visitor::result_type
+ -> variant2::detail::Vret<Visitor, Variant1> The problem is the usage of code in the |
Use decltype, it's C++11: |
I knew there must be a clever way ;) Thanks @pdimov |
Actual behavior
Code that was working fine in Boost. 1.73 now fails to compile:
Expected behavior
Code compiles and runs
C++ Minimal Working Example
Taken from here: https://github.com/apolukhin/Boost-Cookbook/blob/second_edition/Chapter12/07_gil/main.cpp
Environment
<boost/version.hpp>
): develop version of Boost (1.74 beta is probably also affected)The text was updated successfully, but these errors were encountered: