我想编写通用函数,它接收container1的值为[a1,..,an]并返回另一个container2的值为[转换(a1),..,转换(an)]。如果container2是std::vector,问题就微不足道了,std::transform完全符合我的要求。下面的函数可以处理任意的container2和container1templateToTypeconvert(constFromType&from){std::vectortmp;std::transform(from.begin(),from.end(),std::back_inserter(tmp),[](consttypen