Boost logo

Boost :

From: Douglas Gregor (doug.gregor_at_[hidden])
Date: 2006-08-05 23:44:33

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.


Boost list run by bdawes at, gregod at, cpdaniel at, john at