Function and theorem for get/const swap