<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Constexpr on ykiko&#39;s blog</title>
    <link>https://www.ykiko.me/zh-cn/series/constexpr/</link>
    <description>Recent content in Constexpr on ykiko&#39;s blog</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <lastBuildDate>Sun, 29 Mar 2026 15:10:15 +0000</lastBuildDate>
    <atom:link href="https://www.ykiko.me/zh-cn/series/constexpr/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>The History of constexpr in C&#43;&#43;! (Part Two)</title>
      <link>https://www.ykiko.me/zh-cn/articles/683463723/</link>
      <pubDate>Thu, 22 Feb 2024 22:15:32 +0000</pubDate>
      <guid>https://www.ykiko.me/zh-cn/articles/683463723/</guid>
      <description>&lt;p&gt;前情提要：&lt;a href=&#34;https://www.ykiko.me/zh-cn/articles/682031684&#34;&gt;The History of constexpr in C++! (Part One)&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;2015-2016模板的语法糖&#34;&gt;2015-2016：模板的语法糖&lt;/h2&gt;
&lt;p&gt;在 C++ 中支持 &lt;a href=&#34;https://en.cppreference.com/w/cpp/language/template_specialization&#34;&gt;全特化 (full specialization)&lt;/a&gt; 的模板很多，但是支持 &lt;a href=&#34;https://en.cppreference.com/w/cpp/language/partial_specialization&#34;&gt;偏特化 (partial specialization)&lt;/a&gt; 的模板并不多，事实上其实只有类模板 (class template) 和变量模板 (variable template) 两种支持，而变量模板其实可以看做类模板的语法糖，四舍五入一下其实只有类模板支持偏特化。不支持偏特化会导致有些代码十分难写&lt;/p&gt;</description>
    </item>
    <item>
      <title>The History of constexpr in C&#43;&#43;! (Part One)</title>
      <link>https://www.ykiko.me/zh-cn/articles/682031684/</link>
      <pubDate>Sat, 10 Feb 2024 23:15:47 +0000</pubDate>
      <guid>https://www.ykiko.me/zh-cn/articles/682031684/</guid>
      <description>&lt;p&gt;几个月前，我写了一篇介绍 C++ 模板的文章：&lt;a href=&#34;https://www.ykiko.me/zh-cn/articles/655902377&#34;&gt;雾里看花：真正意义上的理解 C++ 模板&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;理清了现代 C++ 中模板的地位。其中用 constexpr function 替代模板进行编译期计算可以说是现代 C++ 最重要的改进之一了。 constexpr 本身其实并不难以理解，非常直观。但是由于几乎每个 C++ 版本都在改进它，所以不同的 C++ 版本可以使用的内容差别很大，有时候可能给人一种 &lt;code&gt;inconsistency&lt;/code&gt; 的感觉。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
