add sum an array using cpp template and vector