Template function in non-template class 
Author Message
 Template function in non-template class

Anybody know what the situation is regarding function templates in a
non-template class. VC++ compiler rejects it unless the function is inlined
in the class itself. Can't define it outside the class (inlined or not). I
don't have the latest copy of the (now ratified) C++ draft in front of me
but I understand this is supported (it works on other compilers I've tried
but that says nothing about what the language itself really dictates). So
I'm left to assume it must really be defined this way (I don't believe so)
or VC++ is behind the times. Can anybody clarify this?


Sat, 24 Mar 2001 03:00:00 GMT  
 Template function in non-template class


Quote:
>Anybody know what the situation is regarding function templates in a
>non-template class. VC++ compiler rejects it unless the function is inlined
>in the class itself. Can't define it outside the class (inlined or not). I
>don't have the latest copy of the (now ratified) C++ draft in front of me
>but I understand this is supported (it works on other compilers I've tried
>but that says nothing about what the language itself really dictates). So
>I'm left to assume it must really be defined this way (I don't believe so)
>or VC++ is behind the times. Can anybody clarify this?

The limitation you describe, and it is a VC++ limitation, is specified
in the VC6 readme file.

--
Doug Harrison



Sat, 24 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. pb with template function in non template class

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

3. Template function in a non-template class

4. Template function in non-template class

5. Syntax for declaring a template class as a friend of a non-template class

6. template functions in template classes declared outside the class definition

7. C++ compiler bug: template and non template function overload resolution

8. template class with a template member function

9. Template function within Template Class

10. template function of non templated class

11. Template member functions of template classes

12. calling template member function in template class

 

 
Powered by phpBB® Forum Software