<!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++]Template classes and Friends</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>&gt; Is there any way I can make class A a friend of class</FONT>
<BR><FONT SIZE=2>&gt; B only when the template parameter TYP2 of A is the</FONT>
<BR><FONT SIZE=2>&gt; same as TYP2 of class B in instantiation ?</FONT>
</P>

<P><FONT SIZE=2>I don't know for sure, but have you tried:</FONT>
</P>

<P><FONT SIZE=2>template &lt;class TYP1&gt;</FONT>
<BR><FONT SIZE=2>class A {</FONT>
<BR><FONT SIZE=2>.....</FONT>
<BR><FONT SIZE=2>&nbsp; friend class B&lt;TYP1&gt;;</FONT>
<BR><FONT SIZE=2>};</FONT>
</P>

<P><FONT SIZE=2>There might be problems with recognizing A&lt;t&gt; with A&lt;t,t&gt;,</FONT>
<BR><FONT SIZE=2>so it there are you may want to try partially specializing</FONT>
<BR><FONT SIZE=2>A (I don't have the right syntax offhand, sorry). Just a</FONT>
<BR><FONT SIZE=2>couple ideas, I don't give any assurance it would work :)</FONT>
</P>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Vincent Penquerc'h </FONT>
</P>

</BODY>
</HTML>