Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2003-12-25 10:01:55


"Vincent Finn" <vincent.finn_at_[hidden]> wrote in message
news:c3cguvcrilj6kji6l75ft0v7gfh7b73jai_at_4ax.com...
> On Tue, 23 Dec 2003 12:39:35 +1100, "Thorsten Ottosen"
> <nesotto_at_[hidden]> wrote:
[snip]

> >P() i basically short for std::make_pair. But for maps you can just
> >2-arguments style list, eg.,
> >
> >std::map<std::string, int> m;
> >m += ( "two", 2 )("three", 3);
> >
> >So is there really any need for P()?
>
> Not if that works but it doesn't for me
> I get
> error C2064: term does not evaluate to a function taking 2 arguments
>
> I can call the more general version
> assign(m) ("two", 2)("three", 3);
> which is OK but not quite as elegant as the += variant

Ahh yeah, that's right. += don't work without P(). I could easily make P()
part of the
interface, I'm just wondering if it is the best name for a function?

br

Thorsten


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