-
Notifications
You must be signed in to change notification settings - Fork 165
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
Replace Boost.MPL with Boost.MP11 #274
Replace Boost.MPL with Boost.MP11 #274
Conversation
The failing checksum test should now be fixed in f45dd04 It's funny how implicit namespace can make refactoring a bit more difficult :-) |
You make me curious. Please explain ! |
@stefanseefeld Let's try. Below, I'm using references to the current implementation based on Boost.MPL so it should be easier to follow. Consider this template: gil/include/boost/gil/channel_algorithm.hpp Lines 103 to 105 in 8d2a90b
Notice, this template which uses unqualified For the Now, for the gil/include/boost/gil/channel.hpp Lines 639 to 643 in 8d2a90b
which is 'called' during specialization of base The Boost.MPL to Boost.MP11 convesrion in this PR replaces the gil/include/boost/gil/channel_algorithm.hpp Lines 118 to 126 in 8d2a90b
instead of this gil/include/boost/gil/channel_algorithm.hpp Lines 135 to 138 in 8d2a90b
that, for the pair of channels in the gil/include/boost/gil/channel_algorithm.hpp Lines 175 to 183 in 8d2a90b
I hope it makes sense :-) |
25ab1d8
to
2e4d7c7
Compare
That's not my business, but I wonder how you are going review this ;) P.S. There are bunch of changes like replacing boost with std type_traits (mpl::true_/false_ also in this category) or silencing warnings that could be done separately. |
It was well understood MPL to MP11 will propose large changeset that may be difficult if not impossible to carefully review diff by diff. This is a big jump and, as every thorough refactoring of non-trivial codebase, it will introduce issues. So, we must continue adding more tests and more detailed tests with hope to fish for the issues - we will spend 3, 6, 9, ... months before we decide we are happy to release it. Finally, despite of the risks, I believe this does not deteriorate any GIL qualities; on the contrary. "You want to change things, you have to break things" :-)
I attempted to remove only those traits or some other traits (e.g. #107), but due to tight coupling of MPL and Boost.TypeTraits (and tight coupling of GIL to those two), it was not practically feasible or required some 'mapping' of traits to C++11 equivalents which would have been clear/remove-refactored again once switching to MP11. I fished for some places where it was possible to apply C++11 features w/o breaking existing MPL-based infrastructure (e.g. #215, #225 and some more). Regardless, number of places where C++11 traits could be used directly was insignificant in comparison to size of the overall changeset required anyway. I'm always advocate surgical strikes at code that introduce manageable diffs, but sometimes it is not feasible (esp. w/ limited time and manpower). |
Build Status UpdateThis PR passes all these builds (compilers info in README.md):
The only failing build is the AzP one for C++17 w/ Boost 1.68 using VS2017:
I'm suspecting this is a problem with MP11 from the older release of Boost 1.68. ResultsThere is an issue in MP11 from Boost 1.68 related to fold expressions (thanks to @pdimov for confirmation). Here is MWE:
PlanUpdate the Azure Pipelines builds to follow the grand rule of "test develop against develop and master against master", as the AppVeyor builds do. |
316cde8
to
3e633ad
Compare
Use type traits and features of C++11, then use Boost.MP11. Remove unused and unnecessary metafunctions in `detail` namespace. Remove explicit access to ::type as no longer necessary with MP11. Clean up and reformat code according to the current guidelines. Legacy tests have been updated where necessary to accommodate switch to MP11. Replace std::is_integral with gil::detail::is_channel_integral Replacing boost::is_integral with std::is_integral is C++ UB: C++11 / 20.11.2 Header <type_traits> synopsis 1 The behavior of a program that adds specializations for any of the class templates defined in this subclause is undefined unless otherwise specified.
3e633ad
to
4617dd6
Compare
I've rebased the PR onto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fantastic. Thanks for all your hard work on this !
I think I'll merge tonight :) Thrilled! |
Ka-Boom! |
Lost in 5611bd5 from #274 merge Credit for catching this goes to @stefanseefeld
Update documentation after boostorg#274.
Update documentation after #274.
Description
detail
namespace.boost::is_integral
withgil::detail::is_channel_integral
to avoid UB.Legacy tests have been updated where necessary to accommodate switch to MP11.
Status
Ready to start review process.
I will try make it easier to review/track changes and submit updates as new commits,
but sometimes I may need to rebase and force-push update. Sorry.
Two files have not been updated and it needs to be decided what to do:
promote_integral.hpp
which is external source borrowed from Boost.Geometry.extension/dynamic_image/reduce.hpp
which is compiled on demand by#define BOOST_GIL_REDUCE_CODE_BLOAT=1
References
Tasklist
promote_integral.hpp
. See Replace Boost.MPL with Boost.MP11 in promote_integral.hpp #280extension/dynamic_image/reduce.hpp
. See Replace Boost.MPL with Boost.MP11 in extension/dynamic_image/reduce.hpp #281test/legacy/image.cpp
forbgr121_*
(fixed in f45dd04)