views:

81

answers:

0

hi there,

i'm getting errors when trying to build the decnumber++ library in vs2008. the error i'm getting is C2995 and C2666. to me it seems visual studio is not allowing template function overloading? if anyone has any ideas i would really love to hear them. if anyone would like to try and build this decimal library in VS to see if they can replicate this, the decnumber c library is here: http://speleotrove.com/decimal/decnumber.html (this built fine btw), and the decnumber++ library is here: http://www.alphaworks.ibm.com/tech/decnumberplusplus/download

an example of the C2995 error, 'function template has already been defined', from the decnumber++ code file 'decimal' pointing to the two culprit function templates:

template< class _LHS, class _RHS> inline    
typename _Arith_LHS_is_int_and_RHS_is_dec<_LHS, _RHS>::type    
operator-(_LHS _L, _RHS _R)
        {
        typedef _FmtTraits<_RHS> _Tr;
        return _DecNumber::_BinaryOp<_DecNumber::_Sub, _Tr>(_L, _R);
        }

template< class _LHS, class _RHS> inline
typename _Arith_LHS_is_dec_and_RHS_is_int_or_dec<_LHS, _RHS>::type
operator-(_LHS _L, _RHS _R)
        {
        typedef _FmtTraits<typename _PromotionTraits<_LHS, _RHS>::type> _Tr;
        return _DecNumber::_BinaryOp<_DecNumber::_Sub, _Tr>(_L, _R);
        }