<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Reference Types on Daniel Lyons</title><link>https://dandylyons.net/topics/reference-types/</link><description>Recent content in Reference Types on Daniel Lyons</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><lastBuildDate>Tue, 04 Feb 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://dandylyons.net/topics/reference-types/index.xml" rel="self" type="application/rss+xml"/><item><title>Easy Deep Copy Cloning in Swift</title><link>https://dandylyons.net/posts/easy-deep-copy-cloning-in-swift/</link><pubDate>Tue, 04 Feb 2025 00:00:00 +0000</pubDate><guid>https://dandylyons.net/posts/easy-deep-copy-cloning-in-swift/</guid><description>&lt;p>In most programming languages, there is some concept of value and reference types. In Swift, we prefer to use value types and value semantics whenever possible. This is because value types are easier to reason about since they cannot be mutated by other parts of the code.&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup> However there are some times when we must use reference types. Is there a way to get our reference types to behave like value types? Yes, there is.&lt;/p></description></item></channel></rss>