
On Mon, Aug 9, 2010 at 1:03 PM, Lorenzo Caminiti <lorcaminiti@gmail.com> wrote:
Hello all,
Can I forward declare a function template that checks concepts using `BOOST_CONCEPT_REQUIRES()`?
In the following example, MSVC gives me an ambiguous call error when I try to do that... (I have not yet tried other compilers).
c00.cpp(28) : error C2668: 'all_equals' : ambiguous call to overloaded function c00.cpp(18): could be 'bool all_equals<std::_Vector_iterator<_Ty,_Alloc>,double>(Iter,Iter,const T &)' with [ _Ty=double, _Alloc=std::allocator<double>, Iter=std::_Vector_iterator<double,std::allocator<double>>, T=double ] c00.cpp(11): or 'bool all_equals<std::_Vector_iterator<_Ty,_Alloc>,double>(Iter,Iter,const T &)' with [ _Ty=double, _Alloc=std::allocator<double>, Iter=std::_Vector_iterator<double,std::allocator<double>>, T=double ] while trying to match the argument list '(std::_Vector_iterator<_Ty,_Alloc>, std::_Vector_iterator<_Ty,_Alloc>, double)' with [ _Ty=double, _Alloc=std::allocator<double> ]
Thank you very much.
Just from looking at the error message this would seem to be a cut-and-dried case of bugs in the compiler. The "overloads" it is saying are ambiguous are identical, meaning they're really just one thing. -- Dave Abrahams BoostPro Computing http://www.boostpro.com