Version compatible with std vectors