Boost logo

Boost :

Subject: Re: [boost] min function that accepts any number of arguments
From: Peng Yu (pengyu.ut_at_[hidden])
Date: 2008-09-03 16:27:35


On Wed, Sep 3, 2008 at 3:11 PM, Sebastian Redl
<sebastian.redl_at_[hidden]> wrote:
> Peng Yu wrote:
>>
>> Hi,
>>
>> std::min accepts only two arguments. When I have more than two
>> arguments to compare, it becomes inconvenient. I'm wondering it is
>> possible to added a min function that accepts any number of arguments
>> in the future version of boost?
>>
>
> Yes, it could probably be done with pseudo-vararg preprocessor magic.
>
> However, the next standard contains a real vararg min. Given that, the
> question is how many people are willing to invest the effort. Pseudo-vararg
> code is a mess.

Since Pseudo-vararg code is a mess, we may not what to do it at this
moment. But GCC has an option -std=c++0x, can the variadic version min
(non-pseudo) be added in boost at least to support GCC before the
upcoming C++ standard finalized?

Thanks,
Peng


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