
8 Oct
2007
8 Oct
'07
7:24 a.m.
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