use common_type trait in fold