• Type Erasure vs Polymorphism

    C++ templates are useful constructs to reduce code bloat (I think of them as fancy copy and paste) without any performance overhead at run-time. However, to use them effectively might require some practice. One issue I recently ran into while working with templates is the following:

    Suppose I have a generic class Foo<T> that takes a template argument, I need to place Foo<T> in a container to be iterated upon or to be looked up later. However, I might have multiple instantiations of Foo<T> of different types (i.e. int, float, double, bool), this makes it hard to use STL containers since these containers require the elements to be of a single type.

    Read more
  • Hello World

    This is the obligatory “Hello World” post.

    After various attempts to use Wordpress, Vue, React, I’ve decided to just switch to Github pages (Jekyll). The setup was fairly painless:

    • The official Github pages guide was very helpful
    • To re-direct my custom domain (bolu.dev) to the Github pages, I followed Hossain Khan’s guide here: https://medium.com/@hossainkhan/using-custom-domain-for-github-pages-86b303d3918a

    The main advantage of moving to Github pages is the ease of setup and migration should I need to do so in the future. There’s no database, almost no-setup, and I can make use of standard git workflows. The posts are in markdown so I can work on it piece-meal whenever I want. Looking forward to see if this motivates me to write more.

    Read more