<!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++]STL and auto_ptr woes</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>&gt; I don't think that auto_ptr&lt;&gt; supports the assignment </FONT>
<BR><FONT SIZE=2>&gt; operator--it only</FONT>
<BR><FONT SIZE=2>&gt; supports initialization via the constructor.&nbsp; That's why it </FONT>
<BR><FONT SIZE=2>&gt; won't work in</FONT>
<BR><FONT SIZE=2>&gt; your scenario.</FONT>
</P>

<P><FONT SIZE=2>[...]</FONT>
</P>

<P><FONT SIZE=2>&gt; Is auto_ptr&lt;&gt; supposed to work in a Standard C++ Library </FONT>
<BR><FONT SIZE=2>&gt; collection?&nbsp; I seem</FONT>
<BR><FONT SIZE=2>&gt; to recall this as being a no-no, but I don't have the book in </FONT>
<BR><FONT SIZE=2>&gt; front of me</FONT>
<BR><FONT SIZE=2>&gt; right now.</FONT>
</P>

<P><FONT SIZE=2>I think you answered your own question. I vaguely remembered</FONT>
<BR><FONT SIZE=2>that auto_ptr is an STL collection would fail because of</FONT>
<BR><FONT SIZE=2>ownership issues when being copied (auto_ptr, IIRC, transfers</FONT>
<BR><FONT SIZE=2>ownership when assigned, so it does not actually duplicate</FONT>
<BR><FONT SIZE=2>but gives (mv rather than cp), so the original collection</FONT>
<BR><FONT SIZE=2>will now hold invalid data). That's what I think I remember,</FONT>
<BR><FONT SIZE=2>I think I got the actual fully explained reason in one of</FONT>
<BR><FONT SIZE=2>Scott Meyer's books, but it's quite fuzzy now, so I could be</FONT>
<BR><FONT SIZE=2>utterly wrong.</FONT>
</P>

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

</BODY>
</HTML>