Should probably `cdef` both `T` and `D`.