Boost logo

Boost :

From: Eric Ford (eford_at_[hidden])
Date: 2001-10-04 20:56:52


> > MAKE_STD_FUNCTION_REAL2 (and SPECIALIZE_...) need to be able to
deal
> > with arguments of differing types. More template arguments...
>
> > ldexp will either need to take two template arguments (even though
we
> > know the second should be an int) or be done separately.

> I'm not sure I understand these two comments. Could you elaborate a
> bit? I understand removing the limitation on the SPECIALIZE_...
macros
> (I've already run into a need to make the return type a parameter
> already for some of the C99 functions). But why does M_S_F_R_2 need
to
> change?

frexp and ldexp need to take a double and an int*. Somehow we must
accomodate that. Maybe you're thinking of a better way. My idea was
to make M_S_F_R_2 take 2 template parameters, one for the return type
and the first parameter type, a second for the second parameter type.
(Alternatively, all three could have their own parameters, which could
help for functions like jn, if they're ever included.) Then it could
be used for both the "normal" two argument functions and frexp and
ldexp. Since you would only specialize for int*, and the default is a
compile error, it doesn't matter if the second parameter is there. But
then you'd need to specialize the relevant functions as templates
taking two parameters rather than one.

Alternatively, you could write out those two functions by hand. That
might be simpler. Maybe there's a third way, too.

E


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