<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>RE: [LC++]Inlining with templated member functions</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>> struct MyStruct {</FONT>
<BR><FONT SIZE=2>> ...</FONT>
<BR><FONT SIZE=2>> template<typename A> void put(A const& a);</FONT>
<BR><FONT SIZE=2>> ...</FONT>
<BR><FONT SIZE=2>> };</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> and later did</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> template<typename A></FONT>
<BR><FONT SIZE=2>> inline void put(A const& a) {</FONT>
<BR><FONT SIZE=2>> ... // do something</FONT>
<BR><FONT SIZE=2>> }</FONT>
</P>
<P><FONT SIZE=2>Shouldn't it be:</FONT>
</P>
<P><FONT SIZE=2>template<typename A></FONT>
<BR><FONT SIZE=2>inline void Mystruct::put<A>(A const& a) {}</FONT>
<BR><FONT SIZE=2>?</FONT>
<BR><FONT SIZE=2>The compiler will see your body as another template function,</FONT>
<BR><FONT SIZE=2>not a method of Mystruct.</FONT>
</P>
<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Vincent Penquerc'h </FONT>
</P>
</BODY>
</HTML>