This is not related to your actual problem but I have noticed that you have side-effects in your FastqReader.front. I think you will benefit from a design where front simply returns the front element and all of the side-effects are inside popFront(). Ali