[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes: | Angus Leeming <[EMAIL PROTECTED]> writes: > | | Finally, I agree that Lars would carry all before him if he used | | code like this. > | I am not quite sure what this sentence means, can you spell it out for | me? | | | The intent is transparent and it is the intent that I'm | | interested in when reading through the code. > | that is of course also my goal. and a lot of intent is hidden in bad | nameing. (match() anyone..., ok we are matching... but _what_. Just | naming the functor EqualBranchNames() would make things a lot | nicer.)
Also the reason why I did all this was a direct result of reading "Effective STL" by Scott Meyers. Main recommandations about functors: - operator() should always be const (functors might be copied around by standard algorightms so depending on local varibles in the functor is _very_ bad, avoid it with const.) - functors should be adaptable (ie. be made to work with standard function adaptors), this is most easily done with deriving functors from std::unary_function of std::binary_function. ...also I have read a bit further now :-) and am not sure I agree with my patch anymore. I think especially maintaince has got harder with my patch, so I need to modify a bit... -- Lgb