Category Archives: Programming

An unfinished draft of Linearly Probed Robin Hood Hash Tables

I was working on a blog article a few months ago but I never finished it. Here’s the first draft, nonetheless. Open Addressing: To store elements in the table itself rather than in nodes pointed-to by the table. Linear Probing: … Continue reading

Posted in Programming | Leave a comment

FOV

I’ve been coding a little roguelike this past week and I just got around to looking atĀ FoV algorithms. Now, many of these algorithms I found hard to understand, but after some trial and error I figured out an easy way … Continue reading

Posted in Programming | Leave a comment

Multi-step iterators using coroutines.

I wanted to turn this multi-step iteration function into an iterator: It turns out that it can be done very simply using boost::asio::coroutine: I thought that was kind of neat. It’s not very often I find a practical use of … Continue reading

Aside | Posted on by | Tagged | Leave a comment

Stack-based template metaprogramming in C++ (11)

Many months ago right after G++ 4.7 was released I discovered a nifty syntax for writing metaprograms using a stack language similiar to Forth and Factor. I started writing a small library around it, but got sidetracked and never finished … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Why don’t we take all the naming problems and push them somewhere else?

Naming class members can be a mess in C++. The simplest idea is to name them like any identifier: class foo { private: int size; }; That’s nice, but what if we want to create a size member function? Unfortunately, … Continue reading

Posted in Programming | Leave a comment

C++ Sucks

Disclaimer: This should be titled “Things about C++ that suck,” but “C++ sucks” is a much better search term. 1. Too many ways to write identical things. This is a language smell. Ideally, there should be one way to write … Continue reading

Posted in Programming | Leave a comment

C++11

Quick overview on things I like and don’t like about C++11. Things I’ve always wanted: Lambdas auto Explicit overrides and final Better enums Better support for unions Variadic templates Custom literals Static assertions Dislike: Things the std can do but … Continue reading

Posted in Programming | Leave a comment