implement template subscripting