Boost logo

Boost :

From: Christian Henning (chhenning_at_[hidden])
Date: 2006-10-30 14:11:50


Hi there, taking the latest GIL source from their site is exposing a
tedious compiler bug with VC2003. I have been trying to find an easy
wokaround but failed. It fails in channel.hpp when trying to define
specializations for channel_min_value() and channel_max_value.

Here is the code:

template <typename T>
typename channel_traits<T>::value_type
inline channel_min_value() { return std::numeric_limits<typename
channel_traits<T>::value_type>::min(); }
template <typename T>
typename channel_traits<T>::value_type
inline channel_max_value() { return std::numeric_limits<typename
channel_traits<T>::value_type>::max(); }

template<> inline bits8 channel_min_value<bits8>() { return 0; }
template<> inline bits8 channel_max_value<bits8>() { return 255; }

template<> inline bits16 channel_min_value<bits16>() { return 0; }
template<> inline bits16 channel_max_value<bits16>() { return 32768; }

template<> inline bits32f channel_min_value<bits32f>() { return 0.0f; }
template<> inline bits32f channel_max_value<bits32f>() { return 1.0f; }

Here is the compiler error messages:

c:\gil\gil\core\channel.hpp(95) : error C2785:
'channel_traits<T>::value_type gil::channel_min_value(void)' and
'gil::bits8 gil::channel_min_value(void)' have different return types
        c:\gil\gil\core\channel.hpp(90) : see declaration of
'gil::channel_min_value'
        c:\gil\gil\core\channel.hpp(95) : see declaration of
'gil::channel_min_value'
c:\gil\gil\core\channel.hpp(95) : error C2912: explicit
specialization; 'gil::bits8 gil::channel_min_value<gil::bits8>(void)'
is not a specialization of a function template
c:\gil\gil\core\channel.hpp(95) : fatal error C1903: unable to recover
from previous error(s); stopping compilation

I have been trying to find a workaround reading some news groups
entry. But all I could find are conformations that this is a bug and
that VC2005 is compiling. Not very helpful. Does anyone here at boost
know a workaround?

I have realized that this request is offtopic. Please, ignore when
feeling that my request is inappropriate.

Thanks,
Christian


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