Julian Barnes said this quote

One of the things he had learned in life, and which he hoped he could rely on, was that a greater pain drives out a lesser one. A strained muscle disappears before toothache, toothache disappears before a crushed finger. He hoped - it was his only hope now - that the pain of cancer, the pain of dying , would drive out the pains of love. It did not seem likely.