Resisting sexual temptation is one thing, forgoing sweets another. Natalie Gold on a study of restraint