He remembered that dance too. Remembered watching the two of them virtually floating round the floor, remembered Ianto's arms slipping around him as they watched - a memory that Ianto didn't have yet, so he was the only one here who shared it with Martha. It made him feel very humble as he was reminded of what he had here, and Martha didn't.
"Perhaps you're just not ready to move on yet," he said gently. "It hasn't been that long, really - only a few months. And it's different from him actually dying. He's still there, still alive, and it makes sense that you're still holding out hope of getting back to him."