Boost logo

Boost Users :

Subject: Re: [Boost-users] fusion io problem
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2013-05-05 04:38:03


On Sat, May 4, 2013 at 11:03 PM, Olaf Peter <ope-devel_at_[hidden]> wrote:

> Hello,
>
> I run into the problem to provide ostream operator<< support for spirit's
> debug facility and for lazyness using fusion's io support:
>
> ---8<---
> #include <boost/fusion/include/adapt_**struct.hpp>
> #include <boost/fusion/include/io.hpp>
> #include <iostream>
>
> namespace fusion = boost::fusion;
>
> namespace client {
>
> struct point {
> int x,y;
> };
>
> template<typename CharT>
> std::basic_ostream<CharT>& operator<<(std::basic_ostream<**CharT>&
> os, point const& p) {
> os << p;
>

As is, this just infinitely recurses, as you observed. What do you want to
do here? Call the Fusion-provided operator<<? Does explicitly qualifying
work? E.g., fusion::operator<<(os, p).

[...]

- Jeff



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