[Boost-bugs] [Boost C++ Libraries] #4910: ambiguity of operator<< in display_expr

Subject: [Boost-bugs] [Boost C++ Libraries] #4910: ambiguity of operator<< in display_expr
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-11-30 02:55:55


#4910: ambiguity of operator<< in display_expr
------------------------------------------------------+---------------------
 Reporter: Maxim Yanchenko <Maxim.Yanchenko@…> | Owner: eric_niebler
     Type: Patches | Status: new
Milestone: To Be Determined | Component: proto
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
------------------------------------------------------+---------------------
 from here:
 http://cpp-next.com/archive/2010/09/expressive-c-playing-with-syntax
 /comment-page-1/#comment-1134

 {{{#!c++
 struct A {};
 struct B:A {};
 std::ostream& operator<<( std::ostream& out, const A& ) { return out <<
 "this is A!"; }
 }}}
 If you do

 {{{#!C++
 proto::display_expr( map( A(), 1 ) );
 }}}

 it works, but if you do

 {{{#!cpp
 proto::display_expr( map( B(), 1 ) );
 }}}

 it doesn't compile due to ambiguity introduced by
 `hidden_detail_::operator<<` that does this nice typeid output.

 The patch for `boost/proto/debug.hpp` against 1.44.0 (works for me) and
 last revision 66440 (not tried to compile, just by analogy) is attached.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4910>
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:04 UTC