Boost logo

Boost :

From: Marco (mrcekets_at_[hidden])
Date: 2007-04-19 19:00:57


On Thu, 19 Apr 2007 23:10:31 +0200, Michael Marcin
<mmarcin_at_[hidden]> wrote:

> I want to enable a function templated on a type T if a function it
> relies on overloaded on that type.
>
.....

>
>
> template< typename T > inline
> typename detail::enable_if_overloaded< T (T), std::asin, radians<T>
> >::type
> my_asin( T x )
> {
> return radians<T>( std::asin( x ) );
> }
>

I tried your code on gcc 4.1.1 and compiler crashes, too.
I found that if the function symbol passed as argument for Signature*
template parameter isn't overloaded, that is there is only one signature
bounded to the function name, your code works correctly.
IMO the problem is : if a function is overloaded what is its type ?
example:

float std::asin(float )
long double std::asin(long double )

tipeof( std::asin ) is "float (float )" or "long double (long double )" ?

I don't know what the standard says about.

Anyway, I don't understand why vc and gcc crash.

Marco

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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