Opened 10 years ago

#7763 new Bugs

Boost.Parameter functions no longer accept non-moveable types as arguments

Reported by: John Bytheway <jbytheway+boost@…> 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.

Attachments (1)

boost_parameter_issue.cpp (510 bytes ) - added by John Bytheway <jbytheway+boost@…> 10 years ago.
Example C++ source demonstrating the issue

Download all attachments as: .zip

Change History (1)

by John Bytheway <jbytheway+boost@…>, 10 years ago

Attachment: boost_parameter_issue.cpp added

Example C++ source demonstrating the issue

Note: See TracTickets for help on using tickets.