Tags » Meta-programming

Generating and calling code on the fly: VBA delegates.

That’s one of the problems I’ve been wanting to solve in VBA for ages, but never really spent the time to actually do it. This weekend I thought I’d tackle it for real, and ended up quite quickly with a working solution. 613 more words

A Meta Programming Use Case: Slugging

In PostIt!, there was a need to D.R.Y. up some of the repetitive code used for slugging URLs.  As you might imagine, the generation of the URL slugs was similar from model to model, apart from the column name seeded to generate the slug.   241 more words

Compile-Time Hash Using constexpr

In this blog entry I present a fairly simple implementation of the djb2 hash function using constexpr which enables the hash to be computed at compile-time. 380 more words