|
Boost : |
From: Daryle Walker (darylew_at_[hidden])
Date: 2001-06-25 12:39:04
on 6/25/01 12:21 AM, Jens Maurer at Jens.Maurer_at_[hidden] wrote:
> David Abrahams wrote:
>>
>> I have often heard it claimed that anything you can do with template template
>> parameters, you can also do without them, but better. I am not familiar with
>> the arguments, so I can't evaluate their validity.
>
> The arguments concerning template-template parameters I heard concerned class
> template parameters only. Here, we're dealing with deduced template-template
> parameters for functions. Note that any "work-arounds" in this area is likely
> to prevent template argument deduction.
Would these problems occur if we do what I suggested:
1. Keep the one-template-argument (which is type-based) versions of sinc_pi
and sinhc_pi. These would work with real, scalar numeric types.
//=========================================================================
template < typename T > T sinc_pi( T const &x );
template < typename T > T sinhc_pi( T const &x );
//=========================================================================
2. In quaternion.hpp and octonion.hpp, we have custom overloaded function
templates of sinc_pi and sinhc_pi.
//=========================================================================
template < typename T > quaternion<T> sinc_pi( quaternion<T> const &x );
template < typename T > quaternion<T> sinhc_pi( quaternion<T> const &x );
template < typename T > octonion<T> sinc_pi( octonion<T> const &x );
template < typename T > octonion<T> sinhc_pi( octonion<T> const &x );
//=========================================================================
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk