Re: [Dev-C++] problems with template especialization
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <ci...@ya...> - 2003-10-06 03:05:07
|
Check out: http://gethelp.devx.com/techtips/cpp_pro/10min/2002/May/10min0502-3.asp Your code seems to be correct, except the template <> and the rest of the function header are supposed to be on different lines. At the above site they give a waring about template specilizations that you should probably take a look at. Hope this helps David McKen ----- Original Message ----- From: Pillati To: dev...@li... Sent: Sunday, October 05, 2003 6:20 PM Subject: [Dev-C++] problems with template especialization Hi! 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? //Image.cpp template <typename T> T Operation(T value) { return value; } template<> int Operation(int val) { return val; } // member method of template class template <typename Type> void Image<Type>::setData() { int a; a = Operation(10); } Raquel. ------------------------------------------ Use o melhor sistema de busca da Internet Radar UOL - http://www.radaruol.com.br --------------------------------------------------------------------- Please read http://www.wxwindows.org/mlhowto.htm before posting. To unsubscribe, e-mail: wx-...@li... For additional commands, e-mail: wx-...@li... ________________________________________________ Este E-mail foi enviado Usando o Software DETECMAIL 1.0 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users --------------------------------- Do you Yahoo!? The New Yahoo! Shopping - with improved product search |