Problem A interesting challenge was brought to my attention: to “flip” an array. I thought it might be more convenient […]
Tag: template-meta-programming
Defer pattern for constructors in C++
Problem In some specific scenarios, I want to run code after the constructor for a class has run (namely: access […]
Execute a function n times, where n is known at compile time
Problem Motivation In this question, a user asked whether it is possible to inline the following function: — simplified version […]
Matching a type T to a list of case statements
Problem I have a compile-time switch_ template that matches a given type T to a list of case_ statements (of […]
Map a set of types to unique IDs and runtime reinterpret back from ID and pointer in C++17
Problem I wanted to create a relatively universal way of serialising an object, by doing a memcpy and generating a […]