A c++ port of @lh3 kseq.h