Re: [Boost-bugs] [Boost C++ Libraries] #7254: Proto expressions are not MPL sequences

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7254: Proto expressions are not MPL sequences
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-08-22 17:14:39


#7254: Proto expressions are not MPL sequences
--------------------------------------+-------------------------------------
  Reporter: mgaunard | Owner: eric_niebler
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: proto
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords:
--------------------------------------+-------------------------------------

Comment (by eric_niebler):

 The following works just fine for me:

 {{{
 #include <iostream>
 #include <typeinfo>
 #include <boost/proto/proto.hpp>
 #include <boost/fusion/mpl.hpp>
 #include <boost/mpl/for_each.hpp>
 #include <boost/mpl/placeholders.hpp>
 #include <boost/type_traits/remove_reference.hpp>
 namespace mpl = boost::mpl;
 namespace proto = boost::proto;
 namespace fusion = boost::fusion;

 template<class E>
 struct my_expr;

 struct my_domain
   : proto::domain<proto::generator<my_expr> >
 {};

 template<class E>
 struct my_expr
   : proto::extends<E, my_expr<E>, my_domain>
 {
     my_expr(E const &e = E())
       : proto::extends<E, my_expr<E>, my_domain>(e)
     {}

     typedef fusion::fusion_sequence_tag tag;
 };

 struct noop
 {
     typedef void result_type;

     template<typename T>
     void operator()(T const &) const
     {
         std::cout << typeid(T).name() << std::endl;
     }
 };

 int main()
 {
     my_expr<proto::terminal<int>::type> i;
     mpl::for_each<decltype(i + i), boost::remove_reference<mpl::_1>
>(noop());
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7254#comment:3>
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:10 UTC