Boost logo

Boost Users :

Subject: [Boost-users] [phoenix] [math] operator<< confusion
From: Christian Henning (chhenning_at_[hidden])
Date: 2008-11-05 14:21:56


Hi there, the following code creates an compiler error since the
operator<< is ambiguous.

#include <boost/math/distributions/gamma.hpp>

#include <boost/spirit/include/phoenix_bind.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>

#include <iostream>
#include <vector>

struct point
{
    double _prob;
    double _x;
};

int _tmain(int argc, _TCHAR* argv[])
{
    using namespace boost::phoenix;
    std::cout << bind( &point::_prob, point() );

    return 0;
}

The error is:

1>.\test.cpp(25) : error C2593: 'operator <<' is ambiguous
1> c:\boost\boost/spirit/home/phoenix/operator/io.hpp(21):
could be 'boost::phoenix::actor<Eval> boost::phoenix::operator
<<<std::ostream,boost::phoenix::composite<EvalPolicy,EvalTuple>>(T0
&,const boost::phoenix::actor<boost::phoenix::composite<EvalPolicy,EvalTuple>>
&)' [found using argument-dependent lookup]

[snip]

1> c:\boost\boost/fusion/sequence/io/out.hpp(36): or
'std::basic_ostream<_Elem,_Traits> &boost::fusion::operators::operator
<<<boost::phoenix::actor<Eval>>(std::ostream &,const Sequence &)'
[found using argument-dependent lookup]
[snip]

I'm using Visual Studio 2005.

Regards,
Christian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net