Re: [Boost-bugs] [Boost C++ Libraries] #2407: [Proto] Error while using operator<< and iostream

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2407: [Proto] Error while using operator<< and iostream
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-10-13 00:39:21


#2407: [Proto] Error while using operator<< and iostream
-----------------------------------------------+----------------------------
  Reporter: Joel Falcou <joel.falcou_at_[hidden]> | Owner: eric_niebler
      Type: Bugs | Status: assigned
 Milestone: Boost 1.37.0 | Component: None
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords: Proto
-----------------------------------------------+----------------------------
Changes (by eric_niebler):

  * owner: => eric_niebler
  * status: new => assigned

Comment:

 {{{
 #include <iostream>
 #include <boost/proto/proto.hpp>

 namespace mpl = boost::mpl;
 namespace proto = boost::proto;
 using proto::_;

 template<class E>
 struct e;

 struct g
   : proto::or_<
         proto::terminal<int>
       , proto::plus<g,g>
>
 {};

 struct d
   : proto::domain<proto::generator<e>, g>
 {};

 template<class E>
 struct e
   : proto::extends<E, e<E>, d>
 {
     BOOST_MPL_ASSERT((proto::matches<E, g>));

     e(E const &x = E())
       : proto::extends<E, e<E>, d>(x)
     {}
 };

 e<proto::terminal<int>::type> i;

 template<class E>
 std::ostream &operator<<(std::ostream &sout, e<E> const &x)
 {
     return sout;
 }

 int main()
 {
     std::cout << (i+i);
 }
 }}}

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2407#comment:1>
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:49:58 UTC