Boost logo

Boost Users :

Subject: Re: [Boost-users] [Spirit?] core dump in endl?
From: Dan Bloomquist (danb_at_[hidden])
Date: 2010-04-12 02:09:21


Hartmut Kaiser wrote:
>> 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
>

I use VS, 2008. My paste and run, that was obvious from the compiler
error and knowing the stream call must return the stream.

What is this that it would compile and run without a proper return?!?

Best, Dan.


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