|
Boost : |
From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2007-10-08 03:24:55
Joel de Guzman wrote:
> Marco Costalba wrote:
[snip]
>> Yes I agree, also because 'overload' is already the name of the
>> struct so perhaps add_function() would be better but also functors
>> can be added so....perhaps just add() is the best, util now ;-)
>
> "add" looks good, until you "add" something outside the overload set.
> You can't.
That's why it's good.
> The right word is "assign".
I beg to differ.
> But then what's wrong with
> operator=?
>
> f = &foo4;
> f = &foo2;
> f = &foo1;
> f = &foo5;
> f = &foo3;
>
At the end of this example one would expect f to only have one overload;
foo3.
IMHO, "add" is good. If one really needs to use operators for adding
overloads, why not use "+="?
/ Johan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk