Christian Ridderström wrote:

> On Mon, 5 Jan 2004, Lars Gullik Bjønnes wrote:
> 
>> If you want obfuscation have a look at this.
>> (no, I won't actually admit that this is obfuscated.)
>> (I find especially the logical_and usage a bit funny :-) )
> 
> Ok... I read about half of it before I got tired... My conclusion is
> that Lars is essentially correct; I was surprised how easy it was to
> understand it in general now.

I agree with all of these comments.

> Look at this code:
> 
> boost::function<bool(Converter const & c)>
> compare_Converter(string const & from, string const & to)
> {
>        return bind(logical_and<bool>(),
>                    bind(equal_to<string>(),
>                         bind(&Converter::from, _1),
>                         from),
>                    bind(equal_to<string>(),
>                         bind(&Converter::to, _1),
>                         to));
> }

I also agree that code such as this is a PITA.

> bool BranchList::remove(string const & s)
> {
> //    list.remove_if(s == getBranch(_1));                      // d)
> 
> return size != list.size();
> }

Finally, I agree that Lars would carry all before him if he used code 
like this. The intent is transparent and it is the intent that I'm 
interested in when reading through the code.

-- 
Angus

Reply via email to