Boost logo

Boost :

From: Hubert Holin (Hubert.Holin_at_[hidden])
Date: 2005-04-21 08:30:03


Somewhere in the E.U., le 21/04/2005

   Bonjour

In article <d43gnq$t9f$1_at_[hidden]>,
 Daniel James <daniel_at_[hidden]> wrote:

> Hubert Holin wrote:
> > Do we have some template metamagic to see if a given function
> > signature is available? I had intended to test computation accuracy for
> > some select values and compare with epsilon for that type (could still
> > use it to check for QOI anyway...).
>
> You can see my crude attempt at this at:
>
> http://lists.boost.org/boost/2005/04/23883.php
> http://lists.boost.org/boost/2005/04/23921.php
>
> I use the return type of the function to tell which overload was called.
> It's a bit odd on Solaris though, as both GCC and the Sun compiler seem
> to have the standard overloads, but my tests fail on GCC which suggests
> that the GCC long double overload doesn't have the full accuracy.
>
> Anyway, the following might be what you want. But I think some config
> macros, with good test cases, would be better.
>
> #include "boost/type_traits/detail/yes_no_type.hpp"
> #include <cmath>
>
> boost::type_traits::no_type is_long_double(double);
> boost::type_traits::yes_type is_long_double(long double);
>
> const bool has_long_double_frexp
> = sizeof(is_long_double(std::frexp((long double) 0.0, 1)))
> == sizeof(boost::type_traits::yes_type);

      Well, it looks like testing for the signature (using your code or
presumably something from the upcoming for review function type library)
will not preclude testing for actual accuracy... Though one can wonder
at this stage if we are still dealing with QOI or a broken library.

   Merci

         Hubert


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