This is a great idea I recently learnt when designing a room that you want to easily transition between being a twin bed on some days and a double bed on others. Buy two stand alone single bed mattresses with bases. But the key is to make one big giant horizontal headboard at the back. Then place a lightweight side table in between.
Then if you want to transform the room easily into a double bed, move out the side table and place to the one side of the bed, you can have another similar side table or I think a stool/chair works well too. Lastly add one of those thinner double mattresses over the beds (that are easy to roll up and store) so that you avoid the problem of the twin bed partion in the middle. Ta- da two rooms in one!
P.S. How gorgeous does this bedroom look with the matching headboard and bases and even the art!