Boost logo

Boost Users :

Subject: Re: [Boost-users] [Spirit?] core dump in endl?
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2010-04-11 18:24:36


> I enclose a Spirit parser with two BOOST_FOREACH loops, one of which
> works and the other coredumps.
> I also enclose a gdb backtrace.
>
> Can you explain what's going on here?

If you add the return statement to your operator<<(), everything will be
fine.
For instance:

  std::ostream& operator<<(std::ostream& o, const test& b) {
    b.print(o);
    return o; // <-- here
  };

Regards Hartmut

---------------
Meet me at BoostCon
www.boostcon.com


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