promise: add Promise::get_index function