I finally figured out years ago what my 'rule' was.
Never go to bed with anyone who you would not enjoy being friends with if you NEVER went to bed with them, or stop being intimate with them.
As a result, I am still friends with several old GFs from many, many years ago.