Templating

  • Thread starter Thread starter JL
  • Start date Start date
J

JL

When trying to template a class where the class
declaration is in a header file and the class
specification is in the source file, I receive linking
errors (Unresolved External Symbols... as if I have not
defined the methods). When I put everything in one file,
it all works beautifully... any suggestions on how to
remedy this problem?

THanks,
 
Content-Class: urn:content-classes:message
From: "JL" <[email protected]>
Sender: "JL" <[email protected]>
Subject: Templating
Date: Thu, 28 Aug 2003 14:25:45 -0700
Lines: 9

When trying to template a class where the class
declaration is in a header file and the class
specification is in the source file, I receive linking
errors (Unresolved External Symbols... as if I have not
defined the methods). When I put everything in one file,
it all works beautifully... any suggestions on how to
remedy this problem?

THanks,

Hi JL: this is the way Visual C++ works: the Visual C++ compiler supports
what is
known as the "inclusion model" for templates: at its simplest this means
that the
full definition of a class template must be available in all compilands in
which
the class template is specialized.
 
Back
Top