[Dev-C++] problems with template especialization
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Pillati <pi...@de...> - 2003-10-05 21:20:21
|
Hi! <BR>I am trying to do with that a member method of a template class
calls another method (with explicit specialization) that doesn't belong that
class and it is defined in the same file. However, I obtain the following
error: "multiple definition of 'int Operation(int)' ". Why doesn't this code
work? <BR><BR>//Image.cpp <BR><BR>template <typename T> <TYPENAME
T><BR>T Operation(T value) <BR>{ return value; } <BR><BR>template<>
int Operation<INT>(int val) <BR>{ return val; } <BR><BR>// member method of
template class <BR>template <typename Type><TYPENAME Type><BR>void
Image<Type><TYPE>::setData() <BR>{ <BR> int a;
<BR> a = Operation(10); <BR>} <BR><BR>Raquel.
<BR><BR><BR><BR>------------------------------------------ <BR>Use o melhor
sistema de busca da Internet <BR>Radar UOL - http://www.radaruol.com.br
<BR><BR><BR><BR><BR>---------------------------------------------------------------------
<BR>Please read http://www.wxwindows.org/mlhowto.htm before posting.
<BR><BR>To unsubscribe, e-mail: wx-...@li...
<BR>For additional commands, e-mail: wx-...@li...
<BR><BR><BR><BR><BR>
<br />
<br />
________________________________________________
<br />
Este E-mail foi enviado Usando o Software DETECMAIL 1.0
<br />
|