﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-力为的技术博客-随笔分类-5. GP&amp;STL&amp;BOOST</title><link>http://www.cppblog.com/mythma/category/147.html</link><description /><language>zh-cn</language><lastBuildDate>Thu, 08 Feb 2018 19:02:05 GMT</lastBuildDate><pubDate>Thu, 08 Feb 2018 19:02:05 GMT</pubDate><ttl>60</ttl><item><title>Buffer和std::stream</title><link>http://www.cppblog.com/mythma/archive/2012/11/07/bufferstream.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Wed, 07 Nov 2012 01:43:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2012/11/07/bufferstream.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/194826.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2012/11/07/bufferstream.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/194826.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/194826.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: std::istreambuf_iterator<br>boost::interprocess::bufferstream&nbsp;&nbsp;<a href='http://www.cppblog.com/mythma/archive/2012/11/07/bufferstream.html'>阅读全文</a><img src ="http://www.cppblog.com/mythma/aggbug/194826.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2012-11-07 09:43 <a href="http://www.cppblog.com/mythma/archive/2012/11/07/bufferstream.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[Ideas] Generic Serialization Framework</title><link>http://www.cppblog.com/mythma/archive/2010/09/30/128130.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Thu, 30 Sep 2010 07:08:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2010/09/30/128130.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/128130.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2010/09/30/128130.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/128130.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/128130.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;&nbsp;&nbsp;1/**///////////////////////////////////////////////////////////////////////////&nbsp;&nbsp;2enum&nbsp;SerializeType&nbsp;&nbsp;3{&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;ST_Read,&nbsp;&nbsp;...&nbsp;&nbsp;<a href='http://www.cppblog.com/mythma/archive/2010/09/30/128130.html'>阅读全文</a><img src ="http://www.cppblog.com/mythma/aggbug/128130.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2010-09-30 15:08 <a href="http://www.cppblog.com/mythma/archive/2010/09/30/128130.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>我的原创技术随笔大全（2000~2009）</title><link>http://www.cppblog.com/mythma/archive/2010/01/09/105218.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Fri, 08 Jan 2010 17:13:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2010/01/09/105218.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/105218.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2010/01/09/105218.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/105218.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/105218.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要:   二十一世纪的第一个十年过去了，回顾了一下这些年写的博客，发现自己也没闲着。但不免也有些遗憾，内容大都是关于知识、经验和技术，而关于思考和idea的却比较少。期待下一个十年吧！<br>    第一篇日志是在2004年发布在CSDN的博客上（记得开始不叫博客），截至到现在累积了不少东西了。为了怀念这过去的十年（2000~2003是个空白期，那段时间国内好像也没博客，网络也不发达，信息也闭塞），特整理了一下，称作我的原创技术随笔大全（2000~2009）&nbsp;&nbsp;<a href='http://www.cppblog.com/mythma/archive/2010/01/09/105218.html'>阅读全文</a><img src ="http://www.cppblog.com/mythma/aggbug/105218.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2010-01-09 01:13 <a href="http://www.cppblog.com/mythma/archive/2010/01/09/105218.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Boost.Python与C++互操作的问题（更新）</title><link>http://www.cppblog.com/mythma/archive/2009/09/13/96051.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Sun, 13 Sep 2009 08:16:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2009/09/13/96051.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/96051.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2009/09/13/96051.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/96051.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/96051.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 现在有一个C++类库Mythma.dll，需要Python用户也可以调用这些服务，所以需要用封装其为Python扩展模块Mythma.pyd。<br>现在有可执行程序PythonConsole.exe，依赖Mythma.dll模块，希望PythonConsole.exe可以调用Python脚本，所以PythonConsole.exe中需要嵌入Python解析器。<br><br>测试过程中遇到一个十分奇怪的问题。&nbsp;&nbsp;<a href='http://www.cppblog.com/mythma/archive/2009/09/13/96051.html'>阅读全文</a><img src ="http://www.cppblog.com/mythma/aggbug/96051.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2009-09-13 16:16 <a href="http://www.cppblog.com/mythma/archive/2009/09/13/96051.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>boost::any 与 boost::variant 的区别</title><link>http://www.cppblog.com/mythma/archive/2008/03/29/45695.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Sat, 29 Mar 2008 11:54:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2008/03/29/45695.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/45695.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2008/03/29/45695.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/45695.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/45695.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 在使用boost::any 和 boost::variant的过程中遇到几个小问题，按个人理解对二者做了一下比较。令人最遗憾的是boost::any与boost::serialization 不兼容。 &nbsp;&nbsp;<a href='http://www.cppblog.com/mythma/archive/2008/03/29/45695.html'>阅读全文</a><img src ="http://www.cppblog.com/mythma/aggbug/45695.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2008-03-29 19:54 <a href="http://www.cppblog.com/mythma/archive/2008/03/29/45695.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>An Adapter Solution</title><link>http://www.cppblog.com/mythma/archive/2006/08/16/11294.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Wed, 16 Aug 2006 09:22:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2006/08/16/11294.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/11294.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2006/08/16/11294.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/11294.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/11294.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: <br>A story about a couple.<br>A story aboutt template.<br>A story about adapter.&nbsp;&nbsp;<a href='http://www.cppblog.com/mythma/archive/2006/08/16/11294.html'>阅读全文</a><img src ="http://www.cppblog.com/mythma/aggbug/11294.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2006-08-16 17:22 <a href="http://www.cppblog.com/mythma/archive/2006/08/16/11294.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>fstream 和 中文路径</title><link>http://www.cppblog.com/mythma/archive/2006/06/09/8349.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Fri, 09 Jun 2006 14:01:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2006/06/09/8349.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/8349.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2006/06/09/8349.html#Feedback</comments><slash:comments>13</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/8349.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/8349.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 问题：<br>有时候用ifstream或ofstream打开带有中文路径的文件会失败。&nbsp;&nbsp;<a href='http://www.cppblog.com/mythma/archive/2006/06/09/8349.html'>阅读全文</a><img src ="http://www.cppblog.com/mythma/aggbug/8349.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2006-06-09 22:01 <a href="http://www.cppblog.com/mythma/archive/2006/06/09/8349.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用std::find查找文件流中的内容</title><link>http://www.cppblog.com/mythma/archive/2006/01/07/2482.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Sat, 07 Jan 2006 02:21:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2006/01/07/2482.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/2482.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2006/01/07/2482.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/2482.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/2482.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 在一般的情况下, 我是很少使用迭代器istream_iterator的。最近在为项目编写一个读特定格式文件的功能时，发现使用istream_iterator和std::find能非常方便的实现文件内容的查找。<br>题外话: <br>1、什么时候可以考虑使用istream_iterator?<br>2、文件中是异构数据情况的处理<br>3、效率问题<br><br>欢迎大家讨论。<br><br>&nbsp;&nbsp;<a href='http://www.cppblog.com/mythma/archive/2006/01/07/2482.html'>阅读全文</a><img src ="http://www.cppblog.com/mythma/aggbug/2482.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2006-01-07 10:21 <a href="http://www.cppblog.com/mythma/archive/2006/01/07/2482.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>const auto_ptr保证拥有权不能转移的实现原理？ </title><link>http://www.cppblog.com/mythma/archive/2005/10/24/836.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Mon, 24 Oct 2005 14:07:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2005/10/24/836.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/836.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2005/10/24/836.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/836.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/836.html</trackback:ping><description><![CDATA[const auto_ptr保证拥有权不能转移的实现原理？ <BR><BR>在《C++标准程序库》p55，提到了auto_ptr使用了一个技巧，能够copy和复制non-const auto_ptr,但不可以copy和复制const atuo_ptr。<BR><BR>可看了之后没感觉，等待高手指点中.....<BR><A href="http://community.csdn.net/Expert/topic/4347/4347660.xml?temp=.3555872">CSDN领分之处：<BR>http://community.csdn.net/Expert/topic/4347/4347660.xml?temp=.3555872</A><BR><BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG id=Code_Closed_Image onclick="this.style.display='none'; Code_Closed_Text.style.display='none'; Code_Open_Image.style.display='inline'; Code_Open_Text.style.display='inline';" height=16 src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" width=11 align=top><IMG id=Code_Open_Image style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text.style.display='none'; Code_Closed_Image.style.display='inline'; Code_Closed_Text.style.display='inline';" height=16 src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" width=11 align=top><SPAN id=Code_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">VC7的</SPAN><SPAN id=Code_Open_Text style="DISPLAY: none"><BR><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">VC7中的<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;TEMPLATE&nbsp;CLASS&nbsp;auto_ptr</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">template</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;_Ty</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;auto_ptr;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>template</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;_Ty</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">struct</SPAN><SPAN style="COLOR: #000000">&nbsp;auto_ptr_ref<BR><IMG id=Codehighlighter1_120_323_Open_Image onclick="this.style.display='none'; Codehighlighter1_120_323_Open_Text.style.display='none'; Codehighlighter1_120_323_Closed_Image.style.display='inline'; Codehighlighter1_120_323_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_120_323_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_120_323_Closed_Text.style.display='none'; Codehighlighter1_120_323_Open_Image.style.display='inline'; Codehighlighter1_120_323_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_120_323_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_120_323_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;proxy&nbsp;reference&nbsp;for&nbsp;auto_ptr&nbsp;copying</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;auto_ptr_ref(auto_ptr</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Ty</SPAN><SPAN style="COLOR: #000000">&gt;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;_Right)<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;_Ref(_Right)<BR><IMG id=Codehighlighter1_218_260_Open_Image onclick="this.style.display='none'; Codehighlighter1_218_260_Open_Text.style.display='none'; Codehighlighter1_218_260_Closed_Image.style.display='inline'; Codehighlighter1_218_260_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_218_260_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_218_260_Closed_Text.style.display='none'; Codehighlighter1_218_260_Open_Image.style.display='inline'; Codehighlighter1_218_260_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_218_260_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_218_260_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;construct&nbsp;from&nbsp;compatible&nbsp;auto_ptr</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;auto_ptr</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Ty</SPAN><SPAN style="COLOR: #000000">&gt;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;_Ref;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;reference&nbsp;to&nbsp;constructor&nbsp;argument</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>template</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;_Ty</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;auto_ptr<BR><IMG id=Codehighlighter1_365_2469_Open_Image onclick="this.style.display='none'; Codehighlighter1_365_2469_Open_Text.style.display='none'; Codehighlighter1_365_2469_Closed_Image.style.display='inline'; Codehighlighter1_365_2469_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_365_2469_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_365_2469_Closed_Text.style.display='none'; Codehighlighter1_365_2469_Open_Image.style.display='inline'; Codehighlighter1_365_2469_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_365_2469_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_365_2469_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;wrap&nbsp;an&nbsp;object&nbsp;pointer&nbsp;to&nbsp;ensure&nbsp;destruction</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">:<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;typedef&nbsp;_Ty&nbsp;element_type;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">explicit</SPAN><SPAN style="COLOR: #000000">&nbsp;auto_ptr(_Ty&nbsp;</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">_Ptr&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">)&nbsp;_THROW0()<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;_Myptr(_Ptr)<BR><IMG id=Codehighlighter1_514_551_Open_Image onclick="this.style.display='none'; Codehighlighter1_514_551_Open_Text.style.display='none'; Codehighlighter1_514_551_Closed_Image.style.display='inline'; Codehighlighter1_514_551_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_514_551_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_514_551_Closed_Text.style.display='none'; Codehighlighter1_514_551_Open_Image.style.display='inline'; Codehighlighter1_514_551_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_514_551_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_514_551_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;construct&nbsp;from&nbsp;object&nbsp;pointer</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;auto_ptr(auto_ptr</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Ty</SPAN><SPAN style="COLOR: #000000">&gt;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;_Right)&nbsp;_THROW0()<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;_Myptr(_Right.release())<BR><IMG id=Codehighlighter1_628_686_Open_Image onclick="this.style.display='none'; Codehighlighter1_628_686_Open_Text.style.display='none'; Codehighlighter1_628_686_Closed_Image.style.display='inline'; Codehighlighter1_628_686_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_628_686_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_628_686_Closed_Text.style.display='none'; Codehighlighter1_628_686_Open_Image.style.display='inline'; Codehighlighter1_628_686_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_628_686_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_628_686_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;construct&nbsp;by&nbsp;assuming&nbsp;pointer&nbsp;from&nbsp;_Right&nbsp;auto_ptr</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;auto_ptr(auto_ptr_ref</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Ty</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;_Right)&nbsp;_THROW0()<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;_Myptr(_Right._Ref.release())<BR><IMG id=Codehighlighter1_771_833_Open_Image onclick="this.style.display='none'; Codehighlighter1_771_833_Open_Text.style.display='none'; Codehighlighter1_771_833_Closed_Image.style.display='inline'; Codehighlighter1_771_833_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_771_833_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_771_833_Closed_Text.style.display='none'; Codehighlighter1_771_833_Open_Image.style.display='inline'; Codehighlighter1_771_833_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_771_833_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_771_833_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;construct&nbsp;by&nbsp;assuming&nbsp;pointer&nbsp;from&nbsp;_Right&nbsp;auto_ptr_ref</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;template</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;_Other</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000">&nbsp;auto_ptr</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Other</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">()&nbsp;_THROW0()<BR><IMG id=Codehighlighter1_902_976_Open_Image onclick="this.style.display='none'; Codehighlighter1_902_976_Open_Text.style.display='none'; Codehighlighter1_902_976_Closed_Image.style.display='inline'; Codehighlighter1_902_976_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_902_976_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_902_976_Closed_Text.style.display='none'; Codehighlighter1_902_976_Open_Image.style.display='inline'; Codehighlighter1_902_976_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_902_976_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_902_976_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;convert&nbsp;to&nbsp;compatible&nbsp;auto_ptr</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;(auto_ptr</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Other</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">));<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;template</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;_Other</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000">&nbsp;auto_ptr_ref</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Other</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">()&nbsp;_THROW0()<BR><IMG id=Codehighlighter1_1049_1131_Open_Image onclick="this.style.display='none'; Codehighlighter1_1049_1131_Open_Text.style.display='none'; Codehighlighter1_1049_1131_Closed_Image.style.display='inline'; Codehighlighter1_1049_1131_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1049_1131_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1049_1131_Closed_Text.style.display='none'; Codehighlighter1_1049_1131_Open_Image.style.display='inline'; Codehighlighter1_1049_1131_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1049_1131_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1049_1131_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;convert&nbsp;to&nbsp;compatible&nbsp;auto_ptr_ref</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;(auto_ptr_ref</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Other</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">));<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;template</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;_Other</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;auto_ptr</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Ty</SPAN><SPAN style="COLOR: #000000">&gt;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">(auto_ptr</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Other</SPAN><SPAN style="COLOR: #000000">&gt;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;_Right)&nbsp;_THROW0()<BR><IMG id=Codehighlighter1_1223_1317_Open_Image onclick="this.style.display='none'; Codehighlighter1_1223_1317_Open_Text.style.display='none'; Codehighlighter1_1223_1317_Closed_Image.style.display='inline'; Codehighlighter1_1223_1317_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1223_1317_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1223_1317_Closed_Text.style.display='none'; Codehighlighter1_1223_1317_Open_Image.style.display='inline'; Codehighlighter1_1223_1317_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1223_1317_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1223_1317_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;assign&nbsp;compatible&nbsp;_Right&nbsp;(assume&nbsp;pointer)</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reset(_Right.release());<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;template</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;_Other</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;auto_ptr(auto_ptr</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Other</SPAN><SPAN style="COLOR: #000000">&gt;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;_Right)&nbsp;_THROW0()<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;_Myptr(_Right.release())<BR><IMG id=Codehighlighter1_1422_1471_Open_Image onclick="this.style.display='none'; Codehighlighter1_1422_1471_Open_Text.style.display='none'; Codehighlighter1_1422_1471_Closed_Image.style.display='inline'; Codehighlighter1_1422_1471_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1422_1471_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1422_1471_Closed_Text.style.display='none'; Codehighlighter1_1422_1471_Open_Image.style.display='inline'; Codehighlighter1_1422_1471_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1422_1471_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1422_1471_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;construct&nbsp;by&nbsp;assuming&nbsp;pointer&nbsp;from&nbsp;_Right</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;auto_ptr</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Ty</SPAN><SPAN style="COLOR: #000000">&gt;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">(auto_ptr</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Ty</SPAN><SPAN style="COLOR: #000000">&gt;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;_Right)&nbsp;_THROW0()<BR><IMG id=Codehighlighter1_1535_1629_Open_Image onclick="this.style.display='none'; Codehighlighter1_1535_1629_Open_Text.style.display='none'; Codehighlighter1_1535_1629_Closed_Image.style.display='inline'; Codehighlighter1_1535_1629_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1535_1629_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1535_1629_Closed_Text.style.display='none'; Codehighlighter1_1535_1629_Open_Image.style.display='inline'; Codehighlighter1_1535_1629_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1535_1629_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1535_1629_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;assign&nbsp;compatible&nbsp;_Right&nbsp;(assume&nbsp;pointer)</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reset(_Right.release());<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;auto_ptr</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Ty</SPAN><SPAN style="COLOR: #000000">&gt;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">(auto_ptr_ref</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">_Ty</SPAN><SPAN style="COLOR: #000000">&gt;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;_Right)&nbsp;_THROW0()<BR><IMG id=Codehighlighter1_1697_1801_Open_Image onclick="this.style.display='none'; Codehighlighter1_1697_1801_Open_Text.style.display='none'; Codehighlighter1_1697_1801_Closed_Image.style.display='inline'; Codehighlighter1_1697_1801_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1697_1801_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1697_1801_Closed_Text.style.display='none'; Codehighlighter1_1697_1801_Open_Image.style.display='inline'; Codehighlighter1_1697_1801_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1697_1801_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1697_1801_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;assign&nbsp;compatible&nbsp;_Right._Ref&nbsp;(assume&nbsp;pointer)</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reset(_Right._Ref.release());<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">~</SPAN><SPAN style="COLOR: #000000">auto_ptr()<BR><IMG id=Codehighlighter1_1819_1862_Open_Image onclick="this.style.display='none'; Codehighlighter1_1819_1862_Open_Text.style.display='none'; Codehighlighter1_1819_1862_Closed_Image.style.display='inline'; Codehighlighter1_1819_1862_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1819_1862_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1819_1862_Closed_Text.style.display='none'; Codehighlighter1_1819_1862_Open_Image.style.display='inline'; Codehighlighter1_1819_1862_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1819_1862_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1819_1862_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;destroy&nbsp;the&nbsp;object</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delete&nbsp;_Myptr;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;_Ty</SPAN><SPAN style="COLOR: #000000">&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">()&nbsp;</SPAN><SPAN style="COLOR: #0