|
Boost : |
From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-05-08 17:54:26
On Tuesday 08 May 2001 02:56 pm, you wrote:
> > > template <typename FUNCTOR,
> > > typename RETURN_TYPE,
> > > typename ARG1,
> > > typename ARG2,
> > > bool useCompare>
>
> UGGHH :-)
>
> You can get rid of functions of more than one
> argument. They don't exist in mathematics, and they
> shouldn't exist in C++ either.
>
> Use the below C program to generate the template
>
> struct_n<class T1, class T2, .. class Tn>
>
> for all n up to a value given on the command line.
>
> Use these structures to pass multiple arguments.
> It is MUCH better to put the complexity of multiple
> arguments into exactly one place, namely the constructors
> of the type 'struct_n', and make everything else accept
> exactly one argument, than to try to handle functions
> of multiple arguments in function.hpp.
>
> If you use 'struct_2', it makes sense to get
> rid of 'pair', which is inconsistently named.
> Unfortunately, you can't just typedef it away, because
> the components are called 'first' and 'second' instead
> of 'mem1' and 'mem2' (which is what they should have been
> called).
[snipped code]
This has already been discussed and rejected - see the callback discussions
in November and December of last year.
Doug
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk