msvc doesn't support "member template functions"? 
Author Message
 msvc doesn't support "member template functions"?

i've read this in msdn library:

----------
In this implementation, if a translator does not support member template
functions, the template:

template<class Pred>
    void sort(Pred pr);
is replaced by:

void sort(greater<T> pr);
----------

and i get everytime the error "list...::sort... cannot convert parameter 1
from 'struct greater<long>' to 'struct std::mygreater<long>'", when i try to
use something like:

list<long> LLIST;

template<class _Ty>
struct mygreater : binary_function<_Ty, _Ty, bool> {
    bool operator()(const _Ty& _X, const _Ty& _Y) const { return _X < _Y; }

Quote:
};

...

LLIST ll;

...

ll.sort(mygreater<long>());    // error

so, msvc really doesn't support "member template functions", does it?

--
mr.black's here...



Mon, 06 Oct 2003 23:58:25 GMT  
 msvc doesn't support "member template functions"?

Quote:

> so, msvc really doesn't support "member template functions", does it?

It didn't do so adequately several years ago, when the library was
packaged. But the compiler has gotten better in this regard. You
can change most of the replacement member functions to member template
functions now. Or you can license the upgrade library from Dinkumware,
which does it for you. Or you can wait for V7.

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



Tue, 07 Oct 2003 02:32:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. "member function templates with explicit specification"

2. Displaying binary data as ascii "1"'s and "0"'s

3. Displaying binary data as ascii "1"'s and "0"'s

4. '.', '::", "->"

5. template member function not supported in c++ ?

6. issuing "MS Access" reports through MSVC

7. why CFile::Write doesn't work for "\n" and "\r"?

8. Why CFile::Write doesn't work for "\n" and "\r"?

9. Does VC++ 6.0 support template 'member template functions'

10. Passing "callback" function to a function

11. Borland 5.0 WIN95 "C" BWCC support

12. "ODBC driver does not support dynasets"

 

 
Powered by phpBB® Forum Software