Boost logo

Boost Users :

Subject: Re: [Boost-users] [Fusion] Output of adapted ADT
From: TONGARI (tongari95_at_[hidden])
Date: 2011-04-08 05:53:53


2011/4/8 Tore Halvorsen <tore.halvorsen_at_[hidden]>

> Hi,
>
> I'm trying to output a string from an adapted class, but I'm getting
> 1>main.cpp(33): error C2679: binary '<<' : no operator found which
> takes a right-hand operand of type
> 'boost::fusion::extension::adt_attribute_proxy<foo,0,false>' (or there
> is no acceptable conversion)
> for the following code (boost 1_46_1, msvc2010)
>
> Is there a header I'm missing? Very similar code works for
> BOOST_FUSION_DEFINE_STRUCT - and using ints or doubles also work...
>

In that case, boost::fusion::front returns not the real element, but a
attribute_proxy that separates the use of getter & setter.

Here's a workaround:
    std::cout << (std::string const&)boost::fusion::front(f) << std::endl;



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