#include <sstream> template <class SRC, class DST> void Str22Num(SRC& src, DST& dst) { std::stringstream in; in << src; std::stringstream out(in.str()); out >> dst; }
参考:https://blog.csdn.net/Vic___/article/details/9324897