<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>Pointer - 標籤 - Yan-Hao Wang&#39;s Blog</title>
        <link>https://kola.ink/tags/pointer/</link>
        <description>Pointer - 標籤 - Yan-Hao Wang&#39;s Blog</description>
        <generator>Hugo -- gohugo.io</generator><language>zh-TW</language><managingEditor>bses30074@gmail.com (Yan-Hao Wang)</managingEditor>
            <webMaster>bses30074@gmail.com (Yan-Hao Wang)</webMaster><copyright>This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.</copyright><lastBuildDate>Fri, 17 Apr 2026 16:49:18 &#43;0800</lastBuildDate><atom:link href="https://kola.ink/tags/pointer/" rel="self" type="application/rss+xml" /><item>
    <title>C&#43;&#43; Smart Pointer 了解</title>
    <link>https://kola.ink/smart-pointer/</link>
    <pubDate>Fri, 17 Apr 2026 16:49:18 &#43;0800</pubDate>
    <author>bses30074@gmail.com (Yan-Hao Wang)</author>
    <guid>https://kola.ink/smart-pointer/</guid>
    <description><![CDATA[<h2 id="筆記">筆記</h2>
<p>使用 <code>make_unique</code> 函式初始化，也可以自己用 <code>unique_ptr</code> 產生，但可能會產生不連續記憶體。</p>
<p>因為他是 unique，所以有一些限制</p>
<ul>
<li>傳遞時只能用 call by value</li>
</ul>
<h3 id="相關函式">相關函式</h3>
<ul>
<li>使 <code>.get()</code> 函式獲得 raw pointer</li>
<li><code>.reset()</code> 函式修改指標指向的類型</li>
<li><code>.release()</code> 釋放變成 raw pointer</li>
</ul>
<h3 id="deleter">Deleter</h3>
<p>可以使用 lambda or struct，但建議使用 struct。</p>]]></description>
</item>
</channel>
</rss>
