Opened 11 years ago
Last modified 9 years ago
#6622 new Bugs
boost::mpl::transform fails on boost::mpl::set in non-inserter form
Reported by: | Owned by: | Aleksey Gurtovoy | |
---|---|---|---|
Milestone: | To Be Determined | Component: | mpl |
Version: | Boost 1.48.0 | Severity: | Problem |
Keywords: | boost::mpl::transform, boost::mpl::set | Cc: |
Description
The following code does not compile with boost-1.48.0:
typedef boost::mpl::transform< boost::mpl::set<double,float>, boost::add_pointer<boost::mpl::_1> >::type pointer_set;
It fails on a compile-time assert deeply into boost.mpl with "REQUESTED_PUSH_FRONT_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST". This makes sense, as boost::mpl::set is not a front extensible sequence. One can get this to work by using a custom inserter that utilises boost::mpl::insert instead of boost::mpl::push_front, or using a different sequence class in the output. However, I think boost::mpl::transform should either be able to detect a set properly, or the documentation should state that the non-inserter version of boost::mpl::transform requires a front extensible sequence.
The documentation for mpl::reverse should also be updated to say it applies to Front Extensible Sequences, too, because mpl::reverse exhibits this same issue.