Opened 10 years ago
#7763 new Bugs
Boost.Parameter functions no longer accept non-moveable types as arguments
Reported by: | Owned by: | Daniel Wallin | |
---|---|---|---|
Milestone: | To Be Determined | Component: | parameter |
Version: | Boost 1.52.0 | Severity: | Regression |
Keywords: | Cc: |
Description
Boost.Parameter suffered a regression because of a change to the semantics of boost::is_convertible. It used to be possible to pass a non-movable type to a Boost.Parameter function, but that no longer works as of Boost 1.47 (at least on certain compilers; gcc continued to work for some more Boost versions but doesn't in 1.52).
The issue with is_convertible was discussed in more detail in this thread: http://boost.2283326.n4.nabble.com/type-traits-parameter-Inconsistent-boost-is-convertible-between-gcc-and-clang-td4634162.html
It first manifested in clang, but now also appears in gcc thanks to the bugfix discussed that thread.
I attach an example demonstrating the problem.
I have worked around the problem locally by editing boost/parameter/preprocessor.hpp and changing
typedef is_convertible<mpl::_, Target> type;
to
typedef is_convertible<mpl::_, const Target&> type;
I make no claim that this is exactly the correct fix, but I believe something along these lines is required.
Example C++ source demonstrating the issue