Boost C++ Libraries: Ticket #11932: Binary MPL transform on empty fusion sequences does not work https://svn.boost.org/trac10/ticket/11932 <p> The following code does not compile with Boost 1.60 in C++11 mode. Tested with recent gcc and clang. </p> <pre class="wiki">#include &lt;boost/mpl/transform.hpp&gt; #include &lt;boost/fusion/container/vector.hpp&gt; #include &lt;boost/fusion/mpl.hpp&gt; struct predicate { template &lt;typename T, typename U&gt; struct apply { typedef T type; }; }; typedef boost::mpl::transform&lt; boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;, predicate&gt; ::type Result; </pre><p> The error is: </p> <pre class="wiki">In file included from test.cpp:2: In file included from boost/include/boost/fusion/container/vector.hpp:12: In file included from boost/include/boost/fusion/container/vector/vector.hpp:28: In file included from boost/include/boost/fusion/container/vector/detail/at_impl.hpp:12: boost/include/boost/fusion/container/vector/detail/value_at_impl.hpp:50:57: error: no matching function for call to 'value_at_impl' typedef typename mpl::identity&lt;decltype(seq::template value_at_impl&lt;N::value&gt;(boost::declval&lt;seq*&gt;()))&gt;::type::type type; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ boost/include/boost/fusion/container/vector/detail/value_of_impl.hpp:30:61: note: in instantiation of template class 'boost::fusion::extension::value_at_impl&lt;boost::fusion::vector_tag&gt;::apply&lt;boost::fusion::vector&lt;&gt;, mpl_::int_&lt;0&gt;&gt;' requested here typedef typename value_at_impl&lt;vector_tag&gt;::template apply&lt;vector, index&gt;::type type; ^ boost/include/boost/fusion/iterator/value_of.hpp:52:15: note: in instantiation of template class 'boost::fusion::extension::value_of_impl&lt;boost::fusion::vector_iterator_tag&gt;::apply&lt;boost::fusion::vector_iterator&lt;boost::fusion::vector&lt;&gt;, 0&gt;&gt;' requested here : extension::value_of_impl&lt;typename detail::tag_of&lt;Iterator&gt;::type&gt;:: ^ boost/include/boost/fusion/iterator/mpl/fusion_iterator.hpp:47:45: note: in instantiation of template class 'boost::fusion::result_of::value_of&lt;boost::fusion::vector_iterator&lt;boost::fusion::vector&lt;&gt;, 0&gt;&gt;' requested here typedef typename fusion::result_of::value_of&lt;Iterator&gt;::type type; ^ boost/include/boost/mpl/iterator_category.hpp:27:22: note: in instantiation of template class 'boost::mpl::fusion_iterator&lt;boost::fusion::vector_iterator&lt;boost::fusion::vector&lt;&gt;, 0&gt;&gt;' requested here typedef typename Iterator::category type; ^ boost/include/boost/mpl/pair_view.hpp:152:20: note: in instantiation of template class 'boost::mpl::iterator_category&lt;boost::mpl::fusion_iterator&lt;boost::fusion::vector_iterator&lt;boost::fusion::vector&lt;&gt;, 0&gt;&gt;&gt;' requested here typename iterator_category&lt;iter1_&gt;::type ^ boost/include/boost/mpl/aux_/has_tag.hpp:20:1: note: in instantiation of template class 'boost::mpl::pair_view&lt;boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;&gt;' requested here BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_tag, tag, false) ^ boost/include/boost/mpl/has_xxx.hpp:245:65: note: expanded from macro 'BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF' , boost::mpl::aux::type_wrapper&lt;BOOST_MSVC_TYPENAME U::name&gt;* = 0 \ ^ boost/include/boost/mpl/aux_/has_tag.hpp:20:1: note: while substituting deduced template arguments into function template 'test' [with U = boost::mpl::pair_view&lt;boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;&gt;] BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_tag, tag, false) ^ boost/include/boost/mpl/has_xxx.hpp:253:18: note: expanded from macro 'BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF' sizeof(gcc_3_2_wknd::test(static_cast&lt;t_*&gt;(0))) \ ^ boost/include/boost/config/suffix.hpp:394:72: note: expanded from macro 'BOOST_STATIC_CONSTANT' # define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment ^ boost/include/boost/mpl/sequence_tag.hpp:112:30: note: in instantiation of template class 'boost::mpl::aux::has_tag&lt;boost::mpl::pair_view&lt;boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;&gt;, mpl_::bool_&lt;false&gt;&gt;' requested here ::boost::mpl::aux::has_tag&lt;Sequence&gt;::value ^ boost/include/boost/mpl/O1_size.hpp:30:30: note: in instantiation of template class 'boost::mpl::sequence_tag&lt;boost::mpl::pair_view&lt;boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;&gt;&gt;' requested here : O1_size_impl&lt; typename sequence_tag&lt;Sequence&gt;::type&gt; ^ boost/include/boost/mpl/fold.hpp:34:25: note: in instantiation of template class 'boost::mpl::O1_size&lt;boost::mpl::pair_view&lt;boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;&gt;&gt;' requested here ::boost::mpl::O1_size&lt;Sequence&gt;::value ^ boost/include/boost/mpl/transform.hpp:75:7: note: in instantiation of template class 'boost::mpl::fold&lt;boost::mpl::pair_view&lt;boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;&gt;, boost::fusion::vector&lt;&gt;, boost::mpl::bind2&lt;boost::mpl::push_back&lt;mpl_::na, mpl_::na&gt;, mpl_::arg&lt;1&gt;, boost::mpl::bind2&lt;predicate, boost::mpl::bind1&lt;boost::mpl::first&lt;mpl_::na&gt;, mpl_::arg&lt;2&gt;&gt;, boost::mpl::bind1&lt;boost::mpl::second&lt;mpl_::na&gt;, mpl_::arg&lt;2&gt;&gt;&gt;&gt;&gt;' requested here : fold&lt; ^ boost/include/boost/mpl/transform.hpp:114:1: note: in instantiation of template class 'boost::mpl::aux::transform2_impl&lt;boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;, predicate, boost::mpl::back_inserter&lt;boost::fusion::vector&lt;&gt;&gt;&gt;' requested here BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, transform2) ^ boost/include/boost/mpl/aux_/inserter_algorithm.hpp:52:7: note: expanded from macro 'BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF' : if_&lt; has_push_back&lt; typename clear&lt;P1&gt;::type&gt; \ ^ boost/include/boost/mpl/eval_if.hpp:38:22: note: in instantiation of template class 'boost::mpl::transform2&lt;boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;, predicate, mpl_::na&gt;' requested here typedef typename f_::type type; ^ boost/include/boost/mpl/transform.hpp:138:1: note: in instantiation of template class 'boost::mpl::eval_if&lt;boost::mpl::or_&lt;boost::mpl::is_na&lt;predicate&gt;, boost::mpl::is_lambda_expression&lt;boost::fusion::vector&lt;&gt;&gt;, boost::mpl::not_&lt;boost::mpl::is_sequence&lt;boost::fusion::vector&lt;&gt;&gt;&gt;, mpl_::bool_&lt;false&gt;, mpl_::bool_&lt;false&gt;&gt;, boost::mpl::transform1&lt;boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;, predicate&gt;, boost::mpl::transform2&lt;boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;, predicate, mpl_::na&gt;&gt;' requested here AUX778076_TRANSFORM_DEF(transform) ^ boost/include/boost/mpl/transform.hpp:125:22: note: expanded from macro 'AUX778076_TRANSFORM_DEF' typedef typename eval_if&lt; \ ^ test.cpp:13:17: note: in instantiation of template class 'boost::mpl::transform&lt;boost::fusion::vector&lt;&gt;, boost::fusion::vector&lt;&gt;, predicate, mpl_::na&gt;' requested here boost::mpl::transform&lt; ^ boost/include/boost/fusion/container/vector/vector.hpp:275:30: note: candidate template ignored: could not match 'store' against 'vector' mpl::identity&lt;U&gt; value_at_impl(store&lt;N, U&gt;*); ^ </pre><p> Kohei has indicated on the mailing list <a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a> that this affects C++11 mode only, and seems to be a regression in 1.60. </p> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a> <a class="ext-link" href="http://boost.2283326.n4.nabble.com/fusion-mpl-binary-MPL-transform-on-empty-fusion-vectors-tp4682832p4682837.html"><span class="icon">​</span>http://boost.2283326.n4.nabble.com/fusion-mpl-binary-MPL-transform-on-empty-fusion-vectors-tp4682832p4682837.html</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11932 Trac 1.4.3 Kohei Takahashi <flast@…> Fri, 22 Jan 2016 01:08:25 GMT keywords, severity, milestone changed https://svn.boost.org/trac10/ticket/11932#comment:1 https://svn.boost.org/trac10/ticket/11932#comment:1 <ul> <li><strong>keywords</strong> C++11 variadics added; regression removed </li> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Regression</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.61.0</span> </li> </ul> <p> Thanks! </p> Ticket Kohei Takahashi <flast@…> Fri, 22 Jan 2016 01:43:06 GMT <link>https://svn.boost.org/trac10/ticket/11932#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11932#comment:2</guid> <description> <p> Here is workaround: <a class="ext-link" href="http://melpon.org/wandbox/permlink/NgLFdyqAua16KStL"><span class="icon">​</span>http://melpon.org/wandbox/permlink/NgLFdyqAua16KStL</a>. </p> </description> <category>Ticket</category> </item> <item> <author>Kohei Takahashi <flast@…></author> <pubDate>Mon, 07 Mar 2016 13:24:51 GMT</pubDate> <title>severity, summary changed; keywords deleted https://svn.boost.org/trac10/ticket/11932#comment:3 https://svn.boost.org/trac10/ticket/11932#comment:3 <ul> <li><strong>keywords</strong> C++11 variadics removed </li> <li><strong>severity</strong> <span class="trac-field-old">Regression</span> → <span class="trac-field-new">Problem</span> </li> <li><strong>summary</strong> <span class="trac-field-old">[1.60 regression] [C++11] Binary MPL transform on empty fusion vectors does not work</span> → <span class="trac-field-new">Binary MPL transform on empty fusion sequences does not work</span> </li> </ul> <p> It seems not a regression but major defect: all of fusion sequences except c++98 vector don't compile. see: <a class="ext-link" href="http://melpon.org/wandbox/permlink/WXfmXnSH7Iqa1kat"><span class="icon">​</span>http://melpon.org/wandbox/permlink/WXfmXnSH7Iqa1kat</a> </p> Ticket Kohei Takahashi Mon, 16 Jul 2018 04:21:37 GMT owner, milestone changed https://svn.boost.org/trac10/ticket/11932#comment:4 https://svn.boost.org/trac10/ticket/11932#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Joel de Guzman</span> to <span class="trac-author">Kohei Takahashi</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.61.0</span> → <span class="trac-field-new">Boost 1.69</span> </li> </ul> Ticket