Boost logo

Boost :

From: AlisdairM (alisdair.meredith_at_[hidden])
Date: 2006-08-06 02:56:56


Douglas Gregor wrote:

> On Aug 5, 2006, at 8:03 PM, Joe Gottman wrote:
>
> > This looks very nice. I hope the standards committee accepts it.
> > I do have
> > one question: is it possible to define a variadic function such
> > that all the
> > variadic parameters are of the same type? This would be useful, for
> > instance, to define a max() function that can finds the max value
> > of any
> > number of parameters:
> >
> > long x1, x2, x3, x4, x5;
> > // Some code
> > const long &max_x = max(x1, x2, x3, x4, x5);
> >
> > If this is possible, would it be possible to define a variadic
> > function
> > without making it a template function?
>
> There's a mention of something similar in the section on interactions
> with initializer lists. This could be an interesting way to go. We'd
> have to see more examples, and look into the implementation of max()
> as well.

Mow, if we could just apply the "homogeneous" concept to the parameter
pack ...

-- 
AlisdairM

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