CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002
    Location
    Vienna, Austria
    Posts
    47

    implementing the member funtion template

    Hi !

    I have some member function templates like:

    Code:
    class CMyClass : public CMyBase
    {
    public:
         template < class T > BOOL Find( std::vector< T > elem );
    }
    Since I have many functions, I don't want to implement them inside the class, but below (in the same header file).
    The problem is: How can I do this ?

    I've tried
    Code:
    template < class T > BOOL CMyClass::Find( std::vector< T > elem )
    {
      ...
    }
    but this doesn't work.
    Do you have any other ideas ?

    Thanks !

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449
    Member templates do not work in Visual C++ 6.0. If you are using VC 6.0, you need to upgrade the compiler to VC 7.0, or get another compiler.

    Regards,

    Paul McKenzie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured