<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Constexpr on Matt Bolitho</title><link>https://mattbolitho.github.io/tags/constexpr/</link><description>Recent content in Constexpr on Matt Bolitho</description><generator>Hugo -- gohugo.io</generator><language>en-GB</language><copyright>Matt Bolitho</copyright><lastBuildDate>Sat, 07 Oct 2023 07:00:00 +0000</lastBuildDate><atom:link href="https://mattbolitho.github.io/tags/constexpr/index.xml" rel="self" type="application/rss+xml"/><item><title>Compile Time 'Hashing' in C++</title><link>https://mattbolitho.github.io/posts/compile-time-hashing-in-c++/</link><pubDate>Sat, 07 Oct 2023 07:00:00 +0000</pubDate><guid>https://mattbolitho.github.io/posts/compile-time-hashing-in-c++/</guid><description>This post is an amalgamation of a couple of previous posts that have been deleted and merged together for cleanliness and conciseness.
Hashing C++ types as compile time identifiers (2023-08-09) Improving constexpr hashing and iteration (2023-08-31) A few months ago, I started looking into compile time hashing in C++. The main reason for this, was wanting a way to identify components in a system at based on their types. This is a pattern that had been used in a previous role, and I found the code that we ended up with being very easy to read and understand.</description></item><item><title>Efficient, configurable functions with constexpr and std::optional</title><link>https://mattbolitho.github.io/posts/efficient-configurable-lambdas-with-constexpr-and-optional/</link><pubDate>Fri, 18 Aug 2023 18:00:00 +0000</pubDate><guid>https://mattbolitho.github.io/posts/efficient-configurable-lambdas-with-constexpr-and-optional/</guid><description>Introduction I was hacking around with a personal project and bumped into a cool thing with constexpr, std::optional, and lambdas. Maybe it&amp;rsquo;s a well known interaction, but I thought I&amp;rsquo;d write a post either way!
The project in question was a library which contains an algorithm that can be parameterised by the user through options. These options are just struct instances which are pretty trivial, plain old data, and compile-time constructable.</description></item></channel></rss>