Boost logo

Boost Users :

From: Stephen Torri (storri_at_[hidden])
Date: 2007-05-19 14:47:08


On Sat, 2007-05-19 at 14:36 -0400, Nat Goodspeed wrote:
> [Nat] Heh. With my VC 7.1 compiler (Version 13.10.3077 according to cl
> /help), the program you sent produces an ICE. But then I'm still on
> Boost 1.31.1.
>
> On the other hand, since the program you sent makes no mention
> whatsoever of boost::lambda, you can remove the boost::bind
> qualification from _1 because there's no ambiguity. I did that, and got
> an error about trying to insert a boost::bind() expression to std::cout.
> Which would sort of toss us back towards boost::lambda.
>
> I thought I'd try using boost::bind on the insertion operator anyway:
>
> std::for_each ( m_data.begin(),
> m_data.end(),
> boost::bind(operator<<, boost::ref(std::cout),
> boost::bind ( &Base::to_String,
> _1,
> indent_value ) ));
>
> but the compiler wasn't buying it.
>
> So... maybe there's a way to express what I was trying to write above,
> or maybe there's a way to express Stuart's boost::lambda::bind
> construct.
>
> But for myself, in this situation I'd consider an explicit 'for' loop
> the clearest expression of intent.
>
> C++ is a truly amazing language that, in many cases, *almost* gets you
> where you want to go. :-)

I am glad to know I still the have skill of breaking compilers. :)

I will leave things as a loop until I hear about any other better
solution.

Thanks for the help.

Stephen


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