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' (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...
#include <iostream>
#include <string>
#include <ostream>
#include
#include
class foo
{
public:
foo(std::string const& str)
: s(str)
{
}
std::string const& get_s() const { return s; }
void set_s(std::string const& str) { s = str; }
private:
std::string s;
};
BOOST_FUSION_ADAPT_ADT(
foo,
(std::string const&, std::string const&, obj.get_s(), obj.set_s(val))
);
int main(int argc, char* argv[])
{
foo f("foo");
std::cout << boost::fusion::front(f) << std::endl;
return EXIT_SUCCESS;
}
--
Eld på åren og sol på eng gjer mannen fegen og fjåg. [Jøtul]
<demo> 2011 Tore Halvorsen || +052 0553034554