Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-06-19 13:04:08


On Tuesday 19 June 2001 13:10, you wrote:
[snip]
> > - Should the number of elements that Tuple supports be easily
>
> configurable?
> We had a set of macros for this, your preprocessing library could
> be of help in this.
> What do others say?

There are quite a few required and usability ties between several different
libraries that have these limits. The required ones are obvious (i.e., lambda
uses tuples internally, so it can support only as many arguments as tuples
does), but the usability issues are a bit more interesting. For instance,
lambda and bind should support the same number of parameters as function.

It would be great if there were a single parameter (BOOST_MAX_ARGUMENTS?)
that dictated how many arguments would be supported by the Boost libraries
overall, with individual macros for libraries (for instance, if the user
needs tuples of length 20 but anywhere else it doesn't matter, it would be
possible). The general scheme would have:

// in config.hpp
#ifndef BOOST_MAX_ARGUMENTS
# define BOOST_MAX_ARGUMENTS 10
#endif

// in tuple
#ifndef BOOST_TUPLE_MAX_ARGUMENTS
# define BOOST_TUPLE_MAX_ARGUMENTS BOOST_MAX_ARGUMENTS
#endif

// etc...

Two caveats:
        - Toggling these parameters breaks binary compatibility.
        - Ifdefs for compatibility will make it very hard to have an arbitrary upper
limit. Boost.Function may have an upper limit that can't be changed with
BOOST_MAX_ARGUMENTS.
 
[snip]

        Doug


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