A problem is that in the Set constructor you assign set_elements an address of a temporary value. It could point to anything afterwards.
I don't really get what you're trying to do, so can't suggest anything.
Do put it all in [code] tags.