Boost logo

Boost :

From: Samuel Krempp (krempp_at_[hidden])
Date: 2002-05-15 10:05:37


Le mer 15/05/2002 à 10:37, Dirk Gerrits a écrit :
> > But it's best to chose between the two syntaxes, taking as a rule that a
> > library should not provide many parallel ways of doing one thing if they
> > all have the same features.
>
> In the Standard library it's common to have a function performing a task
> with overloads taking a variety of arguments. And in addition have an
> operator overload which does the same as the one parameter overloads.

I'm not sure to understand correctly, but you're talking of overloads
here. with overloads, the name of the function is the same, it's quite
different from our situation.

> Look at operator= / assign in some Standard containers just to name one
> example.

Well, this example agrees with my position : one uses operator= for
assigning a vector to another,
while assign is used to initialise a vector with
(size_t n, T val)
or a range (In first, In last).

Thus, the uses of operator= and assign don't overlap at all..

-- 
Sam

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk