On Sun, 4 Jan 2004, Lars Gullik Bjønnes wrote: > >> Where is the obfuscation?
I found list.remove_if(bind2nd(match(), s)); easier to understand on a high level compared to list.remove_if(bind(equal_to<string>(), bind(&Branch::getBranch, _1), s)); but I've never written C++ code with functors... I think this is a case of hiding v.s. showing the details respectively. In this case, I get a bit of an information overload when I have to decipher all the levels of () etc. Another problem is that I don't know what the purpose is of bind(&Branch::getBranch, _1) so I have to guess that, but with only 'match()' I immediately understand that it's about matching. Of course, I don't know _how_ it works, to get an idea of what it does that's not necessary. Anyway, looking at it a bit, I see how it works and it's not that difficult, it's just a bit much in one statement. Maybe it would be more readable if a local variable was used for bind(&Branch::getBranch, _1)... ) Perhaps like this (and remember that I don't know how to use functors): // Temporary operator that returns branch of element. ??? getBranchOperator = bind(&Branch::getBranch, _1); > >> | Would boost::lambda help here? Just guessing from the name 'lambda'... isn't it like the lambda operator in lisp etc? If so, it'd probably help me (but then I like using lambda constructors...). my 0.01 $ /Christian -- Christian Ridderström http://www.md.kth.se/~chr