From: bitland AT aol DOT com (Bitland) Newsgroups: comp.os.msdos.djgpp Subject: who is template-experienced ? Lines: 43 Message-ID: <1998090207405800.DAA29531@ladder01.news.aol.com> NNTP-Posting-Host: ladder01.news.aol.com Date: 2 Sep 1998 07:40:58 GMT Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi ! Perhaps there are FAQ's for, but how to search ... I have three problems using templates: 1.) Defining a template of a class, I have to define all of the functions in the header, or the linker will not find them: Example: template class X { void myfunc(TYP* p); }; template void X::myfunc(TYP* p) { dosomething(); } How can I realize this, I want to keep the functions separated in a cc-file ? 2.) how have I to write defining a templated class as a friend of another one ? class Y { template friend class X; // ?!?!? } 3.) how to declare a templated class in another headerfile ? The compiler will always find two different types of definitions ! If I can't do this, I got problems in my header-structure, because things could need each other. template class X; // ?!?!? Hope to find anyone experienced who can answer me those questions. Please answer to bitland AT aol DOT com Much thanks Andreas Kluge