add swap cpp template version

add template version swap