www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/04/26/03:55:45

Subject: Template problems
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Date: Tue, 25 Apr 1995 10:44:54 +0100 (BST)
From: "B.S.Runnacles" <B DOT S DOT Runnacles AT soton DOT ac DOT uk>

Dear All

I'm having a few problems understanding what exactly to do with templates.
I think I adopt a rather non-standard coding style, in that all my C++ code
is kept in header files with extensions .hxx, and class definitions in files
.h.  I use templates to provide type-independant linked lists, queues etc.
The problem comes when I want to use two lists of the same type in different
source files, say two lists of chars.  When I do this, the linker complains
that I have mutiple references to LinkedList <char>.  

I am aware that this is described in an info page, but I found it poorly 
described and failed to solve the problem.  I would appreciate anyone who 
can shed a little light on this.  

Yours

Ben Runnacles
Image, Speech and Intelligent Systems Group
University of Southampton, UK.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019