Boost logo

Boost :

From: Thorsten Ottosen (tottosen_at_[hidden])
Date: 2006-02-17 08:49:02


Jon Willesen wrote:
> Thorsten Ottosen wrote:

> The only other thing I can think of that concerns me at all is if I'm trying
> to call a function that has been overloaded to take 1..N arguments using the
> preprocessor library or some other code generator. Then this code:
>
> func(list_of<string>(), "foo", "bar", "baz");
>
> might compile successfully and pass four arguments to func when I really meant
> to pass one argument:
>
> func((list_of<string>(), "foo", "bar", "baz"));

I think was the motivation. I had a user that called
a constructor:

cons( list_of(3)(5), 4, 5 );

he wanted to pass 3 arguments, but only one was passed.

I haven't tried it, but is adding parathesis enough to pass
the three arguments forward?

> This particular combination of advanced techniques seems unlikely enough that
> I would still rather have the comma operator. Given no other objections, I
> would vote to have list_of's comma operator reinstated.

Requiring paranthesis in certain contexts seems like a very subtle thing
to do. I like easy syntax, but I also think surprising and subtle
behavior can be
a pain for users.

-Thorsten


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