I'm suggesting what the holy prophet David himself says under the inspiration of the Holy Spirit: that the sin committed is against God only, and it is only to God to Whom the sinner has to confess. It is not expedient, nor even good, for certain others to be made aware of certain sins.
For as David sings:
"Against You, You only, have I sinned
and done what is evil in Your sight,
so that You may be proved right when You speak
and blameless when You judge."
If you, as a person already engaged to, were at the supermarket and a person you were strongly attracted to came into view and you instantly had inappropriate feelings toward them, it is not really something that needs to be confessed to your fiance, or even to your spouse if you are married. It does need to be repented of before God. You do not need to tell your fiance or your spouse. That would quite frankly be a stupid and injurious thing to do to your partner. Tell God about it, because God can handle your sinfulness and still Love you. Don't bother with injuring your partner with your sins that they are too weak to endure. I don't know about every inappropriate thought or feeling that my wife has ever had towards another man, nor do I want or need to know about it. I'll let God be judge of these things and may my wife and I both be forgiven our sins, and enter together into the Kingdom of Heaven.