<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Variant on Pi Stack</title>
    <link>https://www.pistack.xyz/tags/variant/</link>
    <description>Recent content in Variant on Pi Stack</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 26 Jun 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://www.pistack.xyz/tags/variant/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Self-Hosted C&#43;&#43; Variant and Sum Type Libraries: mpark/variant vs tl::expected vs Boost.Variant2</title>
      <link>https://www.pistack.xyz/posts/2026-06-26-cpp-variant-sum-type-libraries-mpark-tl-expected-boost-variant2/</link>
      <pubDate>Fri, 26 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://www.pistack.xyz/posts/2026-06-26-cpp-variant-sum-type-libraries-mpark-tl-expected-boost-variant2/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Before &lt;code&gt;std::variant&lt;/code&gt; arrived in C++17, representing a value that could be one of several types required either a tagged union (error-prone, no type safety) or inheritance-based polymorphism (heap allocation, virtual dispatch overhead). Even with &lt;code&gt;std::variant&lt;/code&gt; available, there are important use cases that the standard library doesn&amp;rsquo;t fully address: backporting to older C++ standards, never-valueless guarantees, and monadic error handling for function return types.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
