Boost logo

Boost :

From: Michael Stevens (mail_at_[hidden])
Date: 2005-06-28 14:40:34


Dear All,

I was hoping that VC8 would finally fix up problems with it's ambiguity
resolution system for function template arguments.

Sadly the current beta version as used for Boost regression tests still has
problems. See
http://engineering.meta-comm.com/boost-regression/CVS-HEAD/developer/output/RudbekAssociates-bin-boost-libs-numeric-ublas-test-test1-test-vc-8_0-debug-threading-multi.html
for a failure in Boost::uBLAS. The same problem is not shown for previous VC
compilers as the offending tests are simply disabled.

The problem can easily be exemplified with the follow code which still fails
on VC-8

struct range {
};

template<class V>
struct vector_range {
        typedef range range_type;
};
template<class V>
struct vector_slice {
        typedef range range_type;
};

template<class V>
void simple (V &data, const range &r)
{}
template<class V>
void simple (vector_slice<V> &data, const range &r)
{}

template<class V>
void hard (V &data, const typename vector_range<V>::range_type &r)
{}
template<class V>
void hard (vector_slice<V> &data, const typename vector_slice<V>::range_type
&r)
{}

main ()
{
        vector_slice<int> vs;
        simple (vs, range() );
        hard (vs, range() );
}

There are no problems with the functions 'simple'.
It thinks the functions 'hard' are ambiguous despite the fact that the first
parameter is more specialised in the second version. It seems to be disturbed
by template parameter dependence of the second parameter.

Anyone know of a workaround?

For those that know a little more about MS compiler, or have support for it.
Is the current beta of VC-8 close to the final version or is it likely that i
such deeply rooted template problems are going be fixed?

Michael

-- 
___________________________________
Michael Stevens Systems Engineering
34128 Kassel, Germany
Navigation Systems, Estimation  and
                 Bayesian Filtering
    http://bayesclasses.sf.net
___________________________________

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