<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Crtp on icyveins7's blog</title><link>https://icyveins7.github.io/tags/crtp/</link><description>Recent content in Crtp 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>Sat, 04 May 2024 20:00:00 +0800</lastBuildDate><atom:link href="https://icyveins7.github.io/tags/crtp/index.xml" rel="self" type="application/rss+xml"/><item><title>CRTP, method chaining, and static polymorphism</title><link>https://icyveins7.github.io/posts/2024/05/crtp-method-chaining-and-static-polymorphism/</link><pubDate>Sat, 04 May 2024 20:00:00 +0800</pubDate><guid>https://icyveins7.github.io/posts/2024/05/crtp-method-chaining-and-static-polymorphism/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;Yes, it&amp;rsquo;s yet another blogpost about CRTP and how it&amp;rsquo;d be useful..&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;h1 id="the-1st-issue-method-chaining"&gt;The 1st issue: method chaining&lt;/h1&gt;&#10;&lt;p&gt;Have you seen a billion other blogposts about CRTP? Yes, so have I. But maybe there&amp;rsquo;s a reason for all of them; it wasn&amp;rsquo;t really apparent when reading them previously why it would be useful and/or why I would ever need it.&lt;/p&gt;&#10;&lt;p&gt;But recently, while writing some simple templated code for &lt;a href="https://github.com/icyveins7/ufl"&gt;&lt;code&gt;ufl&lt;/code&gt;&lt;/a&gt;, I had the bright idea of trying to make method chaining possible for the class. That&amp;rsquo;s when my templated class and its derived friend implementation started to fall apart. I fixed this by using CRTP for the first time.&lt;/p&gt;</description></item></channel></rss>