Recent Posts
- First steps in Zig (0.15.2)
- Installing NetWare 3.12 in QEMU
- [Contributed] How to: get root on a Foscam FI9831W (2017)
- Implementing a std::function<>-like wrapper in C++, part 3: using a static storage buffer
- Implementing a std::function<>-like wrapper in C++, part 2: generalizing the return type and arguments
Recent Comments
No comments to show.
Category Archives: Programming
First steps in Zig (0.15.2)
Introduction A few weeks ago, I was replaying an old ’90-ies adventure game and… I got stuck. I decided to look up online hints, and remembered the https://www.uhs-hints.com website (back in the early 2000s, this used to be a very … Continue reading
Implementing a std::function<>-like wrapper in C++, part 3: using a static storage buffer
Previously, we’ve made our version of std::move_only_function<> generic so that it can be used to store any function signature, regardless of the number of parameters or return type. The implementation we’ve ended up with is the following: This works for … Continue reading
Implementing a std::function<>-like wrapper in C++, part 2: generalizing the return type and arguments
Introduction Previously, we’ve seen a way to implement our own version of std::move_only_function<>. The implementation we ended up with is as follows: This works for any movable function, for example: Unfortunately, it is restricted to the function prototype int fn(int, … Continue reading
Implementing a std::function<>-like wrapper in C++, part 1: type erasing
Introduction Recently, a chat with a friend peeked my interested: how would you store an arbitrary function and call it, similar to std::function<>. It turned out a plain C function pointer would suffice for this specific use-case, but I got … Continue reading
Behind the magic of magic_enum
Recently, a coworker pointed me towards a C++17 library to convert enumeration values to strings and vice versa. The library called magic_enum (https://github.com/Neargye/magic_enum) and it indeed feels like magic. I was immediately curious: how did they pull this off? The … Continue reading