Boost C++ Libraries: Ticket #5414: Errors compiling a piece of fusion with phoenix. Pheonix bug? https://svn.boost.org/trac10/ticket/5414 <p> Hi, </p> <p> I've implemented a dot product of two fusion vectors as a phoenix 2 functor. However it doesn't compile and dies deep inside of phoenix. Is this a bug, or a misunderstanding on my part? </p> <p> Thanks, Joe </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5414 Trac 1.4.3 joe@… Mon, 04 Apr 2011 03:34:44 GMT attachment set https://svn.boost.org/trac10/ticket/5414 https://svn.boost.org/trac10/ticket/5414 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">dot_product_bug.cpp</span> </li> </ul> <p> Source </p> Ticket joe@… Mon, 04 Apr 2011 03:35:34 GMT attachment set https://svn.boost.org/trac10/ticket/5414 https://svn.boost.org/trac10/ticket/5414 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">log.txt</span> </li> </ul> <p> Compilation output. </p> Ticket Joel de Guzman Mon, 04 Apr 2011 06:06:20 GMT <link>https://svn.boost.org/trac10/ticket/5414#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5414#comment:1</guid> <description> <p> I suggest you use Phoenix-3 instead. See Ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5480" title="#5480: Feature Requests: Doxygen: Support for C++0x =default and =delete (closed: fixed)">#5480</a>. I am confident that this is no longer an issue. Please do so and tell us your experience so we can close both tickets. If it is still a problem, then let's move this tickets to Phoenix. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Thomas Heller</dc:creator> <pubDate>Mon, 04 Apr 2011 06:29:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5414#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5414#comment:2</guid> <description> <p> This testcase is working with V3 (minor modifications for the nested result template needed) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Thomas Heller</dc:creator> <pubDate>Mon, 04 Apr 2011 17:24:51 GMT</pubDate> <title>status, component, version changed; cc, resolution set https://svn.boost.org/trac10/ticket/5414#comment:3 https://svn.boost.org/trac10/ticket/5414#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">thom.heller@…</span> added </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>component</strong> <span class="trac-field-old">spirit</span> → <span class="trac-field-new">phoenix</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.47.0</span> → <span class="trac-field-new">Boost Development Trunk</span> </li> </ul> Ticket joe@… Tue, 05 Apr 2011 09:08:32 GMT <link>https://svn.boost.org/trac10/ticket/5414#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5414#comment:4</guid> <description> <p> What are those minor modifications? </p> <p> Can you tell me what's wrong with this please? (It works for pheonix 2) </p> <pre class="wiki"> template &lt;typename V1, typename V2&gt; struct result { // Presume that the return type is the type of the first element // of the first sequence argument. typedef typename boost::fusion::result_of::value_at&lt;V1, boost::mpl::int_&lt;0&gt; &gt;::type type; }; </pre> </description> <category>Ticket</category> </item> <item> <author>joe@…</author> <pubDate>Tue, 05 Apr 2011 09:17:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5414#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5414#comment:5</guid> <description> <p> For the record </p> <p> <a class="ext-link" href="https://svn.boost.org/svn/boost/trunk/libs/phoenix/example/function.cpp"><span class="icon">​</span>https://svn.boost.org/svn/boost/trunk/libs/phoenix/example/function.cpp</a> is wrong then? </p> <p> linked to from the lazy function docs </p> <p> <a class="ext-link" href="https://svn.boost.org/svn/boost/trunk/libs/phoenix/doc/html/phoenix/starter_kit/lazy_functions.html"><span class="icon">​</span>https://svn.boost.org/svn/boost/trunk/libs/phoenix/doc/html/phoenix/starter_kit/lazy_functions.html</a> </p> <p> It's wrong then? :) </p> </description> <category>Ticket</category> </item> <item> <author>joe@…</author> <pubDate>Tue, 05 Apr 2011 10:07:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5414#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5414#comment:6</guid> <description> <p> Still trying to get this result struct working. What's wrong with this then? </p> <pre class="wiki"> struct vector_dot_product_impl { template&lt;typename V1, typename V2&gt; struct result; template &lt;typename This, typename V1, typename V2&gt; struct result&lt;This(V1, V2)&gt; { // Presume that the return type is the type of the first element // of the first sequence argument. typedef typename boost::fusion::result_of::value_at&lt;V1, boost::mpl::int_&lt;0&gt; &gt;::type type; }; template &lt;typename V1, typename V2&gt; typename result&lt;V1, V2&gt;::type operator()(V1 v1, V2 v2) const { using boost::phoenix::arg_names::_1; using boost::phoenix::arg_names::_2; using boost::fusion::fold; using boost::fusion::transform; return fold(transform(v1, v2, _1 * _2), 0.0, _1 + _2); } }; </pre><p> Thanks! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 05 Apr 2011 10:35:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5414#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5414#comment:7</guid> <description> <p> It's ok. I've sussed it out. It has to be </p> <pre class="wiki"> template&lt;typename Sig&gt; struct result; </pre><p> not </p> <pre class="wiki"> template&lt;typename V1, typename V2&gt; struct result; ]}} </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Thomas Heller</dc:creator> <pubDate>Wed, 13 Jul 2011 07:54:32 GMT</pubDate> <title>version, milestone changed https://svn.boost.org/trac10/ticket/5414#comment:8 https://svn.boost.org/trac10/ticket/5414#comment:8 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost Development Trunk</span> → <span class="trac-field-new">Boost 1.46.0</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.48.0</span> </li> </ul> Ticket