Boost logo

Boost :

From: Jason Shirk (jasonsh_at_[hidden])
Date: 2005-06-30 14:49:13


I fixed this problem after Beta 2. I can't think of a workaround. We
are failing type deduction too early during partial ordering when
encountering a dependent type.

If you try the June CTP (community technology preview), I think you'll
see the fix, but if not, rest assured, I verified our most recent
internal build compiles this example cleanly (well, we warn about the
use of default int as the return type in main().)

--
Jason Shirk
VC++ Compiler Team
-----Original Message-----
From: Michael Stevens [mailto:mail_at_[hidden]] 
Sent: Tuesday, June 28, 2005 12:41 PM
Subject: VC8 function template ambiguity problems
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/out
put/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
___________________________________
_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost

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