Does VC++ 6.0 support template 'member template functions' 
Author Message
 Does VC++ 6.0 support template 'member template functions'

I am trying to sort an STL list using the form:

list.sort(CompFunc op)

and get the error:

        No constructor could take the source type, or constructor overload
resolution was ambiguous

This form of the sort function requires support for member function
templates. Is the error the result of VC++ v6.0 SP5 not supporting these?

Many thanks.



Mon, 03 Jan 2005 04:20:11 GMT  
 Does VC++ 6.0 support template 'member template functions'

Quote:
> I am trying to sort an STL list using the form:

> list.sort(CompFunc op)

> and get the error:

>         No constructor could take the source type, or constructor overload
> resolution was ambiguous

> This form of the sort function requires support for member function
> templates. Is the error the result of VC++ v6.0 SP5 not supporting these?

Historically, yes. You can now safely supply the missing template qualifier:

template<class _Pr3>    // add this line
 void merge(_Myt& _X, _Pr3 _Pr)
.....
template<class _Pr3>    // add this line
 void sort(_Pr3 _Pr)

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com



Mon, 03 Jan 2005 04:25:14 GMT  
 Does VC++ 6.0 support template 'member template functions'
Many thanks -- that's a fast response!

Quote:


> > I am trying to sort an STL list using the form:

> > list.sort(CompFunc op)

> > and get the error:

> >         No constructor could take the source type, or constructor
overload
> > resolution was ambiguous

> > This form of the sort function requires support for member function
> > templates. Is the error the result of VC++ v6.0 SP5 not supporting
these?

> Historically, yes. You can now safely supply the missing template
qualifier:

> template<class _Pr3>    // add this line
>  void merge(_Myt& _X, _Pr3 _Pr)
> .....
> template<class _Pr3>    // add this line
>  void sort(_Pr3 _Pr)

> P.J. Plauger
> Dinkumware, Ltd.
> http://www.dinkumware.com



Mon, 03 Jan 2005 04:35:33 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Simple question: Member function templates in template classes under VC++ 5.0

2. Using member function templates in template class under VC++ 5.0

3. Member template functions in VC++ 6.0?

4. can't invoke template class member function

5. exporting template class' member functions from dll

6. template class with a template member function

7. Template member functions of template classes

8. calling template member function in template class

9. Function template as member in a class template

10. template member function - non template class - VC5 - error

11. template template parameter that VC++ does NOT support

12. calling template member function in template class

 

 
Powered by phpBB® Forum Software