Tag Archives: c++

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

Posted in Programming | Tagged | Leave a comment

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

Posted in Programming | Tagged | Leave a comment