<?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>C&#43;&#43; on Wokron&#39;s Blog</title>
    <link>https://wokron.github.io/en/tags/c&#43;&#43;/</link>
    <description>Recent content in C&#43;&#43; on Wokron&#39;s Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>©2022-2026 Yitang Yang. All rights reserved.</copyright>
    <lastBuildDate>Fri, 01 Aug 2025 13:29:24 +0800</lastBuildDate>
    <atom:link href="https://wokron.github.io/en/tags/c++/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Which Parameter Type Should I Use?</title>
      <link>https://wokron.github.io/en/posts/cpp-parameter-types/</link>
      <pubDate>Fri, 01 Aug 2025 13:29:24 +0800</pubDate>
      <guid>https://wokron.github.io/en/posts/cpp-parameter-types/</guid>
      <description>In this article, we&amp;rsquo;ll discuss a small but practical question: when should you use each kind of function parameter type?
Classifying Parameters Suppose we have a type T (to keep things simple, T here is not a generic type parameter). How many ways are there to pass a parameter of this type to a function? Let&amp;rsquo;s break it down:
Qualifier: const-qualified or not Reference category: by value, by lvalue reference, by rvalue reference Based on this classification, we get exactly 5 parameter types:</description>
    </item>
    <item>
      <title>Writing a Compile-Time Sort</title>
      <link>https://wokron.github.io/en/posts/compile-time-sort/</link>
      <pubDate>Fri, 07 Mar 2025 16:17:03 +0800</pubDate>
      <guid>https://wokron.github.io/en/posts/compile-time-sort/</guid>
      <description>Let&amp;rsquo;s have some fun with templates this time.
C++ has std::integer_sequence, which lets you define compile-time integer sequences. For example:
#include &amp;lt;utility&amp;gt; using my_seq = std::integer_sequence&amp;lt;int, 1, 2, 3, 4, 5&amp;gt;; Now let&amp;rsquo;s write a seq_sort_t trait that performs compile-time sorting, something like:
using my_seq = std::integer_sequence&amp;lt;int, 2, 5, 3, 1, 4&amp;gt;; using sorted_my_seq = seq_sort_t&amp;lt;my_seq&amp;gt;; // std::integer_sequence&amp;lt;int, 1, 2, 3, 4, 5&amp;gt; Let&amp;rsquo;s start with some groundwork.
Runtime Output Use type extraction to convert std::integer_sequence into a runtime std::initializer_list for easy output.</description>
    </item>
    <item>
      <title>A Practical CMake Tutorial</title>
      <link>https://wokron.github.io/en/posts/practical-cmake-tutorial/</link>
      <pubDate>Sun, 03 Sep 2023 11:00:23 +0800</pubDate>
      <guid>https://wokron.github.io/en/posts/practical-cmake-tutorial/</guid>
      <description>1. Introduction I&amp;rsquo;ve been working on a C++ project recently and had to learn CMake. Honestly, CMake&amp;rsquo;s quirky syntax can be quite intimidating at first. But once you get hands-on, you&amp;rsquo;ll find that only a small subset is needed day-to-day, and it generally follows predictable patterns. Master this subset and you can likely organize a fairly large project. That&amp;rsquo;s exactly what this tutorial aims to cover.
Of course, you&amp;rsquo;ll need to understand compilation and linking before reading this.</description>
    </item>
  </channel>
</rss>
