Imitate standard template library