<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Unique_ptr on icyveins7's blog</title><link>https://icyveins7.github.io/tags/unique_ptr/</link><description>Recent content in Unique_ptr on icyveins7's blog</description><generator>Hugo</generator><language>en-us</language><copyright>This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.</copyright><lastBuildDate>Sun, 23 Feb 2025 20:00:00 +0800</lastBuildDate><atom:link href="https://icyveins7.github.io/tags/unique_ptr/index.xml" rel="self" type="application/rss+xml"/><item><title>When circumstances don’t allow you to use unique_ptr</title><link>https://icyveins7.github.io/posts/2025/02/when-circumstances-dont-allow-you-to-use-unique_ptr/</link><pubDate>Sun, 23 Feb 2025 20:00:00 +0800</pubDate><guid>https://icyveins7.github.io/posts/2025/02/when-circumstances-dont-allow-you-to-use-unique_ptr/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;Some background on my single header file memory manager and why I made it..&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Picture this. You are working on a codebase with some &lt;del&gt;lazy&lt;/del&gt; &lt;del&gt;inept&lt;/del&gt; questionable decisions from external forces. You are given a class to work on. For the purposes of this post let’s call it &lt;code&gt;MyClass&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;The class will have its methods invoked in the following order:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&lt;code&gt;MyClass()&lt;/code&gt; i.e. the constructor.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;setup(…)&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;run(…)&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;teardown()&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Repeat 2-4 many times.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;~MyClass()&lt;/code&gt; i.e. the destructor.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;This class will be reused in multiple different scenarios repeatedly, with different input data.&lt;/p&gt;</description></item></channel></rss>