Thread: Function template in Class template?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    162

    Question Function template in a Class template?

    What's the syntax for a "function template" in a "class template"?

    Code:
    template <class ClsType>
    class Class {
    	template <typename FuncType>
    	void Function(FuncType Object);
    };
    
    template <class ClsType>
    template <typename FuncType>
    void Class<ClsType>::Function(FuncType Object) {
    	//...
    }
    How should this ex. have been written to compile correctly?
    (Please note that I don't wish ClsType and FuncType to be equal.)

    Thanks in advance
    Last edited by Aidman; 10-28-2003 at 08:04 AM.
    We haven't inherited Earth from our parents; instead we have borrowed her from our children - old Indian saying.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Needs help in Dev-C++
    By Korrupt Lawz in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2010, 01:17 AM
  2. Default class template problem
    By Elysia in forum C++ Programming
    Replies: 5
    Last Post: 07-11-2008, 08:44 AM
  3. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  4. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM
  5. Data init inside of template class function
    By VirtualAce in forum C++ Programming
    Replies: 1
    Last Post: 04-24-2002, 03:11 PM