Boost logo

Boost :

Subject: Re: [boost] New libraries implementing C++11 features in C++03
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2011-11-25 11:34:56


Joel de Guzman wrote:
> Now, how about error messages. Here's the lambda part:
>
> std::for_each(vec.begin(), vec.end(), plus4(_1, b, l, s));
>
> You'd have to be absurdly dumb to get that wrong!

I encountered the following ways to get such a thing wrong (with Boost.Bind) in the past:
1) I included both Boost.Lambda and Boost.Bind, and somehow managed that the compiler used the Boost.Lambda placeholders instead of the Boost.Bind placeholders. This produced a weird error message, if I remember correctly.
2) Make something wrong related to the number of arguments (I don't remember exactly details anymore). Got an internal compiler error from MSVC8 instead of an error message.

At least the compiler crash once took me a long time to find out what I did wrong, even so it was something really obviously wrong (after I found it).

I guess it's better now with Boost.Phoenix. However, perhaps interactions between std::bind and Boost.Phoenix similar to the interactions between Boost.Bind and Boost.Lambda will also generate a similar experience for newer generations of programmers.

Regards,
Thomas


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk