Re: [Boost-bugs] [Boost C++ Libraries] #5414: Errors compiling a piece of fusion with phoenix. Pheonix bug?

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5414: Errors compiling a piece of fusion with phoenix. Pheonix bug?
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-05 10:07:03


#5414: Errors compiling a piece of fusion with phoenix. Pheonix bug?
--------------------------------------+-------------------------------------
  Reporter: joe@… | Owner: djowel
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: phoenix
   Version: Boost Development Trunk | Severity: Problem
Resolution: fixed | Keywords:
--------------------------------------+-------------------------------------

Comment (by joe@…):

 Still trying to get this result struct working. What's wrong with this
 then?

 {{{

 struct vector_dot_product_impl {
         template<typename V1, typename V2>
         struct result;

         template <typename This, typename V1, typename V2>
         struct result<This(V1, V2)>
         {
                 // 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<V1,
 boost::mpl::int_<0> >::type type;
         };

         template <typename V1, typename V2>
         typename result<V1, V2>::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);
         }
 };
 }}}

 Thanks!

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5414#comment:6>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC